Search Postgresql Archives

Re: join from array or cursor

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

 



On Fri, Aug 21, 2009 at 01:58:34PM -0400, Merlin Moncure wrote:
> On Fri, Aug 21, 2009 at 1:13 PM, Sam Mason<sam@xxxxxxxxxxxxx> wrote:
> > On Fri, Aug 21, 2009 at 12:05:51PM -0400, Tom Lane wrote:
> >> 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
> >
> > 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));
> 
> The first form is not allowed because subqueries used that way must
> return only one column.  The second form works because the extra
> parens constructs a row type which gets around that restriction.

I was under the impression that the message Tom was pointing to was
about lifting this restriction.  I believe the use case was of being
able to do:

  UPDATE foo SET (a,b,c) = (SELECT 1,2,3);

if I'm reading things correctly.  I was expecting this to be generally
available where any sub-select was supported and hence I was wondering
what its semantics would be.  It seemed like an interesting corner case
and I'd not seen it discussed in the linked threads.

If I'm not reading things correctly then the rest is a mute point.

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

[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