| From: | hubert depesz lubaczewski <depesz(at)depesz(dot)com> |
|---|---|
| To: | Tarlika Elisabeth Schmitz <postgresql3(at)numerixtechnology(dot)de> |
| Cc: | pgsql-general(at)postgresql(dot)org, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
| Subject: | Re: each (hstore) |
| Date: | 2011-05-17 11:41:49 |
| Message-ID: | 20110517114149.GB549@depesz.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Tue, May 17, 2011 at 12:27:08PM +0100, Tarlika Elisabeth Schmitz wrote:
> On Pavel's blog, I found this statement, which does just what I need:
>
> select (each(hstore(foo))).* from foo;
>
>
> Excuse the daft question, but could, please, you explain what ".*" does?
each(hstore) is a function that returns set of records. each record can
have many fields.
when you have value which is record, you can add .* to get all columns
from it, separately. since each(hstore) is expression, and not column
name/alias - you need to wrap is in () before adding .*
Best regards,
depesz
--
The best thing about modern society is how easy it is to avoid contact with it.
http://depesz.com/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Grzegorz Szpetkowski | 2011-05-17 12:19:58 | Re: Granting privileges on all tables,sequences , views, procedures |
| Previous Message | Tarlika Elisabeth Schmitz | 2011-05-17 11:27:08 | each (hstore) |