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

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Joe Conway <mail(at)joeconway(dot)com>, "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)
Date: 2006-08-01 20:26:44
Message-ID: 20060801202644.GA19514@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers pgsql-patches

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 update to src do
> regression-# insert into log values(old.*, 'old'), (new.*, 'new');
> CREATE RULE
> regression=# update src set f2 = f2 + 1;
> server closed the connection unexpectedly

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');
?

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Joe Conway 2006-08-01 20:41:28 Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
Previous Message Tom Lane 2006-08-01 20:15:51 Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2006-08-01 20:40:28 Re: Replication Documentation
Previous Message Christopher Browne 2006-08-01 20:25:00 Re: New variable server_version_num

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2006-08-01 20:40:28 Re: Replication Documentation
Previous Message Christopher Browne 2006-08-01 20:25:00 Re: New variable server_version_num