Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] - Mailing list pgsql-hackers

From Joe Conway
Subject Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
Date
Msg-id 44CC0F48.9020805@joeconway.com
Whole thread Raw
In response to Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
>>One of the things I'm struggling with is lack of column aliases. Would 
>>it be reasonable to require something like this?

> Requiring column aliases is counter to spec ...

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

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

I figured as much, but thought I'd ask anyway :-). I did find something 
in the appendix to the spec after sending this:

Annex C
(informative)
Implementation-dependent elements

18) Subclause 7.3, “<table value constructor>”:
a) The column names of a <table value constructor> or a <contextually 
typed table value constructor>
are implementation-dependent.

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

OK, I just thought "?column?" was ugly and useless.

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

Where do I find that algorithm -- somewhere in nodeAppend.c?

Thanks,

Joe



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCHES] New variable server_version_num
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] putting CHECK_FOR_INTERRUPTS in