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

2006-08-01 Thread Tom Lane
I've found a problem with the VALUES-as-RTE approach: regression=# create table src(f1 int, f2 int); CREATE TABLE regression=# create table log(f1 int, f2 int, tag text); CREATE TABLE regression=# insert into src values(1,2); INSERT 0 1 regression=# create rule r2 as on update to src do

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

2006-08-01 Thread Alvaro Herrera
Tom Lane wrote: I've found a problem with the VALUES-as-RTE approach: regression=# create table src(f1 int, f2 int); CREATE TABLE regression=# create table log(f1 int, f2 int, tag text); CREATE TABLE regression=# insert into src values(1,2); INSERT 0 1 regression=# create rule r2 as on

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

2006-08-01 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Does it work if you do regression=# create rule r2 as on update to src do regression-# insert into log values(old.f1, old.f2, 'old'), (new.f1, new.f2, 'new'); No, that's not the problem. * expansion works just fine here, it's the executor that can't

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

2006-08-01 Thread Tom Lane
Joe Conway [EMAIL PROTECTED] writes: Tom Lane wrote: What I'm inclined to do for 8.2 is to disallow OLD/NEW references in multi-element VALUES clauses; the feature is still tremendously useful without that. Given the timing, this sounds like a reasonable approach. I agree that the feature

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

2006-07-29 Thread Tom Lane
Joe Conway [EMAIL PROTECTED] 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

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

2006-07-29 Thread Tom Lane
Joe Conway [EMAIL PROTECTED] writes: Tom Lane wrote: As for the types, I believe that the spec pretty much dictates that we apply the same type resolution algorithm as for a UNION. Where do I find that algorithm -- somewhere in nodeAppend.c? select_common_type(), in the parser.