Re: each (hstore) - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: each (hstore)
Date
Msg-id 20110517114149.GB549@depesz.com
Whole thread Raw
In response to each (hstore)  (Tarlika Elisabeth Schmitz <postgresql3@numerixtechnology.de>)
List 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/

pgsql-general by date:

Previous
From: Tarlika Elisabeth Schmitz
Date:
Subject: each (hstore)
Next
From: Grzegorz Szpetkowski
Date:
Subject: Re: Granting privileges on all tables,sequences , views, procedures