Skip site navigation (1) Skip section navigation (2)

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

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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]
Date: 2006-07-30 01:45:44
Message-ID: 44CC0F48.9020805@joeconway.com (view raw or flat)
Thread:
Lists: pgsql-docspgsql-hackerspgsql-patches
Tom Lane wrote:
> 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?

> 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


In response to

Responses

pgsql-docs by date

Next:From: Tom LaneDate: 2006-07-30 01:50:03
Subject: Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)
Previous:From: Joe ConwayDate: 2006-07-30 01:37:35
Subject: Re: [HACKERS] 8.2 features?

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2006-07-30 01:48:30
Subject: Re: [HACKERS] putting CHECK_FOR_INTERRUPTS in
Previous:From: Bruce MomjianDate: 2006-07-30 01:45:25
Subject: Re: [HACKERS] pg_regress breaks on msys

pgsql-patches by date

Next:From: Bruce MomjianDate: 2006-07-30 01:48:30
Subject: Re: [HACKERS] putting CHECK_FOR_INTERRUPTS in
Previous:From: Bruce MomjianDate: 2006-07-30 01:45:25
Subject: Re: [HACKERS] pg_regress breaks on msys

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group