On Fri, Aug 21, 2009 at 12:05:51PM -0400, Tom Lane wrote: > Sam Mason <sam@xxxxxxxxxxxxx> writes: > > ... PG should instead arrange that the expression > > "t" is run exactly once and reuse the single result for all columns. > > We might be able to do that based on the row-returning-subselect > infrastructure being discussed over here: > http://archives.postgresql.org/message-id/4087.1250867036@xxxxxxxxxxxxx Huh, fun. Not sure if I'm interpreting this correctly, but what would the difference in semantics between: SELECT (SELECT 1,2); and SELECT (SELECT (1,2)); PG seems to make the distinction somewhat blurry at the moment. For example, upthread I did: SELECT (id((SELECT (1,2)::foo))).*; and got back two columns, and yet when I do what I think is equivalent: SELECT x.* FROM (SELECT (1,2)::foo) x; I get back my tuple, and not the values inside my tuple. Should I be posting this to -hackers? -- Sam http://samason.me.uk/ -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general