X-Original-To: pgsql-hackers-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 02C1A9FB1EC for ; Wed, 2 Aug 2006 03:54:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 00111-07 for ; Wed, 2 Aug 2006 06:54:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from grzm.com (grzm.com [200.46.204.98]) by postgresql.org (Postfix) with ESMTP id E9CC69FA4C8 for ; Wed, 2 Aug 2006 03:54:10 -0300 (ADT) Received: from localhost (unknown [200.46.208.251]) by grzm.com (Postfix) with ESMTP id 2A493127E134 for ; Wed, 2 Aug 2006 07:54:08 +0100 (BST) Received: from grzm.com ([200.46.204.98]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 06345-03; Wed, 2 Aug 2006 03:54:05 -0300 (ADT) Received: from [172.16.1.101] (unknown [61.197.227.146]) by grzm.com (Postfix) with ESMTP id 56064127E053; Wed, 2 Aug 2006 07:54:01 +0100 (BST) In-Reply-To: <44D0205E.9060300@joeconway.com> References: <200608020314.k723EbQ01079@momjian.us> <44D0205E.9060300@joeconway.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <1CD9D95B-E824-4A0D-85BB-279AD06B931C@seespotcode.net> Cc: Bruce Momjian , Tom Lane , "Hackers (PostgreSQL)" Content-Transfer-Encoding: 7bit From: Michael Glaesemann Subject: Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Date: Wed, 2 Aug 2006 15:54:00 +0900 To: Joe Conway X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL X-Spam-Level: *** X-Archive-Number: 200608/68 X-Sequence-Number: 87561 On Aug 2, 2006, at 12:47 , Joe Conway wrote: > regression=# create rule r2 as on update to src do insert into log > values(old.*, 'old'), (new.*, 'new'); > ERROR: VALUES must not contain OLD or NEW references > Would it make sense to add a HINT as well, recommending the UNION construct Tom mentioned earlier? On Aug 2, 2006, at 11:52 , Tom Lane wrote: > create rule r2 as on update to src do > insert into log select old.*, 'old' union all new.*, 'new'; > > or just use two separate INSERT commands in the rule. > Or is the general case too, uh, general for a HINT? Michael Glaesemann grzm seespotcode net