Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Christopher Kings-Lynne <chris(dot)kings-lynne(at)calorieking(dot)com>, "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Bernd Helmle <mailings(at)oopsware(dot)de>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Susanne Ebrecht <susanne(dot)ebrecht(at)credativ(dot)de>
Subject: Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)
Date: 2006-07-30 01:35:24
Message-ID: 21398.1154223324@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers pgsql-patches

Joe Conway <mail(at)joeconway(dot)com> writes:
> One of the things I'm struggling with is lack of column aliases. Would
> it be reasonable to require something like this?

> SELECT ... FROM (VALUES ...) AS foo(col1, col2, ...)

Requiring column aliases is counter to spec ...

> The other issue is how to determine column type. Even better would be to
> require (similar to SRF returning record):

> SELECT ... FROM (VALUES ...) AS foo(col1 type1, col2 type2, ...)

... and this is even further away from it.

As for the names, just use "?column?", same as we do now in INSERT
... VALUES. Anyone who wants to refer to those columns explicitly will
need to assign aliases, but if they don't assign aliases, we don't have
to do anything very intelligent.

As for the types, I believe that the spec pretty much dictates that we
apply the same type resolution algorithm as for a UNION. This is fairly
expensive and we should avoid it in the case of INSERT ... VALUES, but
for VALUES appearing anywhere else I think we have little choice.

regards, tom lane

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Joe Conway 2006-07-30 01:37:35 Re: [HACKERS] 8.2 features?
Previous Message Tom Lane 2006-07-30 01:27:20 Re: [HACKERS] 8.2 features?

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2006-07-30 01:37:35 Re: [HACKERS] 8.2 features?
Previous Message Tom Lane 2006-07-30 01:27:20 Re: [HACKERS] 8.2 features?

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2006-07-30 01:37:35 Re: [HACKERS] 8.2 features?
Previous Message Tom Lane 2006-07-30 01:27:20 Re: [HACKERS] 8.2 features?