X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 65D10D1E82D for ; Tue, 20 Jan 2004 19:06:28 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 02673-09 for ; Tue, 20 Jan 2004 15:05:57 -0400 (AST) Received: from anchor-post-37.mail.demon.net (anchor-post-36.mail.demon.net [194.217.242.86]) by svr1.postgresql.org (Postfix) with ESMTP id 36539D1E887 for ; Tue, 20 Jan 2004 15:05:50 -0400 (AST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-37.mail.demon.net with esmtp (Exim 3.35 #1) id 1Aj1CA-0008F5-0b; Tue, 20 Jan 2004 19:05:50 +0000 Received: by mainbox.archonet.com (Postfix, from userid 529) id 12B3118299; Tue, 20 Jan 2004 19:05:48 +0000 (GMT) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id F037716B9C; Tue, 20 Jan 2004 19:05:46 +0000 (GMT) From: Richard Huxton To: Tom Lane , Harald Fuchs Subject: Re: Trigger question Date: Tue, 20 Jan 2004 19:05:46 +0000 User-Agent: KMail/1.5 Cc: pgsql-performance@postgresql.org References: <400691EA.96598C34@t1.unisoftbg.com> <24605.1074616950@sss.pgh.pa.us> In-Reply-To: <24605.1074616950@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200401201905.46699.dev@archonet.com> X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.15.3 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/201 X-Sequence-Number: 5375 On Tuesday 20 January 2004 16:42, Tom Lane wrote: > Harald Fuchs writes: > > Why? If the underlying table has a primary key, finding corresponding > > pairs is trivial; if there isn't, it's impossible. > > Exactly. Nonetheless, the correspondence exists --- the UPDATE > definitely updated some particular row of the OLD set into some > particular one of the NEW set. If the trigger API makes it impossible > to reconstruct the matchup, the API is broken. Perhaps they should be cursors? The only sensible way I can think of working with them would be: 1. count how many rows affected 2. step through one row at a time, doing something. I suppose there might be cases where you'd want to GROUP BY... which would mean you'd need some oid/row-id added to a "real" recordset. -- Richard Huxton Archonet Ltd