Re: Polymorphic arguments and composite types

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Polymorphic arguments and composite types
Date: 2007-10-05 18:16:04
Message-ID: 1191608164.4223.437.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 2007-10-05 at 10:59 -0700, Stephan Szabo wrote:
> On Fri, 5 Oct 2007, Simon Riggs wrote:
>
> > On Fri, 2007-10-05 at 10:32 -0700, Stephan Szabo wrote:
> > > On Fri, 5 Oct 2007, Simon Riggs wrote:
> > >
> > > > Because we already do exactly that here:
> > > >
> > > > select 1, (select col2 from c), 3;
> > > >
> > > > The inner select returns a ROW, yet we treat it as a single column
> > > > value.
> > >
> > > The inner select does not return a row. It's not a <row subquery>, it's a
> > > <scalar subquery>.
> >
> > Thanks Stephan, Tom already explained that.
> >
> > My comments above were in response to "Why would you think that?"
>
> Right, but I guess I couldn't see why you would consider that the same as
> treating a rowtype as a scalar, because when I look at that my brain
> converts that to a scalar subquery, so I guess I simply see the scalar.
> If we supported select 1, (select 2,3), select 4 giving something like
> (1,(2,3),4), I'd also have confusion over the case, but that should error.

Well, my brain didn't... All I've said was that we should document it,
to help those people that don't know they're SQL standard as good as the
best people on this list.

--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2007-10-05 18:24:20 Re: Polymorphic arguments and composite types
Previous Message Stephan Szabo 2007-10-05 17:59:48 Re: Polymorphic arguments and composite types