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

From Tom Lane
Subject Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)
Date
Msg-id 28624.1154487120@sss.pgh.pa.us
Whole thread Raw
In response to Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]  (Joe Conway <mail@joeconway.com>)
Responses Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
List pgsql-hackers
Joe Conway <mail@joeconway.com> 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 has lots of interesting uses -- I'd hate to see us lose 
> that. Disallowing OLD/NEW references doesn't contradict the spec in any 
> way AFAIK either.

I don't think rules are in the spec at all ;-) ... so no, that's not
a problem.  My example demonstrated a pretty likely use:

create rule r2 as on update to src doinsert into log values(old.*, 'old'), (new.*, 'new');

but for the moment we can tell people to work around it the way
they always have:

create rule r2 as on update to src doinsert into log select old.*, 'old' union all new.*, 'new';

or just use two separate INSERT commands in the rule.

We oughta fix it later, but I don't feel ashamed to have a restriction
like this in the first cut.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [PATCHES] Replication Documentation
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] Replication Documentation