X-Original-To: pgsql-hackers-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 00D579FB2B6 for ; Tue, 1 Aug 2006 17:26:55 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 35970-10 for ; Tue, 1 Aug 2006 17:26:49 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from lists.commandprompt.com (host-130.commandprompt.net [207.173.203.130]) by postgresql.org (Postfix) with ESMTP id DA25B9FB1BE for ; Tue, 1 Aug 2006 17:26:48 -0300 (ADT) Received: from alvh.no-ip.org (200-126-100-4.bk7-dsl.surnet.cl [200.126.100.4]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k71KQnr5022385; Tue, 1 Aug 2006 13:26:49 -0700 Received: by alvh.no-ip.org (Postfix, from userid 1000) id 9A2C3C2F879; Tue, 1 Aug 2006 16:26:44 -0400 (CLT) Date: Tue, 1 Aug 2006 16:26:44 -0400 From: Alvaro Herrera To: Tom Lane Cc: Joe Conway , "Hackers (PostgreSQL)" Subject: Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Message-ID: <20060801202644.GA19514@alvh.no-ip.org> Mail-Followup-To: Tom Lane , Joe Conway , "Hackers (PostgreSQL)" References: <44BF122F.1080200@joeconway.com> <23927.1153373971@sss.pgh.pa.us> <44C00E1E.1000405@joeconway.com> <14047.1153442773@sss.pgh.pa.us> <44C4451A.4010906@joeconway.com> <11495.1153757531@sss.pgh.pa.us> <44C4F625.2050304@joeconway.com> <12029.1153760969@sss.pgh.pa.us> <44CC0A66.6070903@joeconway.com> <16429.1154463351@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16429.1154463351@sss.pgh.pa.us> User-Agent: Mutt/1.5.12-2006-07-14 X-Virus-Scanned: ClamAV version 0.88.3, clamav-milter version 0.88.3 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Tue, 01 Aug 2006 13:26:50 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.94 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200608/46 X-Sequence-Number: 87539 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