Search Postgresql Archives

Re: Select + Functions + Composite Types: Behavior

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

 



Tom,

BTW, with the quick response you provided (THANKS!) I probably should have
pinged the list sooner in my search...

David J.

-----Original Message-----
From: Tom Lane [mailto:tgl@xxxxxxxxxxxxx] 
Sent: Saturday, February 12, 2011 5:33 PM
To: David Johnston
Cc: pgsql-general@xxxxxxxxxxxxxx
Subject: Re:  Select + Functions + Composite Types: Behavior 

"David Johnston" <polobo@xxxxxxxxx> writes:
> If I put a function that returns a composite type into the FROM clause 
> of a SELECT query (and it - the function - is the only source for the 
> query) the "*" select list expands so that there is a single record 
> for each component of the composite type.

> SELECT * FROM compositereturningfunction() Yields -> 2 columns (one 
> for id and one for data)

> I've read quite a bit about plpgsql and composite types and do not 
> recall anything about this specific default behavior and methods to 
> force
> (workaround) to the other behavior.

It's just like tables. Try

	select x from compositereturningfunction() x

			regards, tom lane


-- 
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