Search Postgresql Archives

Re: each (hstore)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux