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 F129ED1B43F for ; Tue, 20 Jan 2004 16:31:15 +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 65064-02 for ; Tue, 20 Jan 2004 12:30:45 -0400 (AST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 17DB9D1E1FB for ; Tue, 20 Jan 2004 12:30:45 -0400 (AST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 2FD19355CE; Tue, 20 Jan 2004 08:30:29 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 2E62935588; Tue, 20 Jan 2004 08:30:29 -0800 (PST) Date: Tue, 20 Jan 2004 08:30:29 -0800 (PST) From: Stephan Szabo To: Harald Fuchs Cc: pgsql-performance@postgresql.org Subject: Re: Trigger question In-Reply-To: Message-ID: <20040120082719.S69928@megazone.bigpanda.com> References: <400691EA.96598C34@t1.unisoftbg.com> <871xpvij42.fsf@mailbox.samurai.com> <200401200813.57147.dev@archonet.com> <24300.1074614549@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/199 X-Sequence-Number: 5373 On Tue, 20 Jan 2004, Harald Fuchs wrote: > In article <24300.1074614549@sss.pgh.pa.us>, > Tom Lane writes: > > > Richard Huxton writes: > >> On Tuesday 20 January 2004 00:01, Neil Conway wrote: > >>> Yeah, I didn't get around to implementing that. If anyone wants this > >>> feature, I'd encourage them to step up to the plate -- I'm not sure > >>> when I'll get the opportunity/motivation to implement this myself. > > >> I didn't think they'd be meaningful for a statement-level trigger. Surely > >> OLD/NEW are by definition row-level details. > > > According to the complainants, OLD/NEW are commonly available as > > recordsets (tables) inside a statement trigger. > > Yes. > > > I'm not very clear on > > how that works myself --- in particular, one would think it important to > > be able to work with corresponding pairs of OLD and NEW rows, which > > would be painful with a table-like abstraction. > > Why? If the underlying table has a primary key, finding corresponding > pairs is trivial; if there isn't, it's impossible. I don't think that's sufficient unless you can guarantee that the primary key values never change for any reason that causes the trigger to try to correspond them.