X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 9DD4B9FB2DB for ; Thu, 13 Jul 2006 20:31:52 -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 83496-06 for ; Thu, 13 Jul 2006 20:31:49 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.192.83]) by postgresql.org (Postfix) with ESMTP id 30C309FAC76 for ; Thu, 13 Jul 2006 20:31:48 -0300 (ADT) Received: from [192.168.0.9] (c-24-17-161-80.hsd1.wa.comcast.net[24.17.161.80]) by comcast.net (rwcrmhc13) with ESMTP id <20060713233147m1300d9j3ae>; Thu, 13 Jul 2006 23:31:47 +0000 From: Adrian Klaver Reply-To: aklaver@comcast.net To: pgsql-sql@postgresql.org Subject: Re: Trigger, record "old" is not assigned yet Date: Thu, 13 Jul 2006 16:38:53 -0700 User-Agent: KMail/1.6.2 Cc: "Daniel Caune" References: <1E293D3FF63A3740B10AD5AAD88535D202A29F60@UBIMAIL1.ubisoft.org> In-Reply-To: <1E293D3FF63A3740B10AD5AAD88535D202A29F60@UBIMAIL1.ubisoft.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200607131638.54001.aklaver@comcast.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/205 X-Sequence-Number: 25779 For plpgsql use TG_OP. See link below. http://www.postgresql.org/docs/8.1/interactive/plpgsql-trigger.html On Thursday 13 July 2006 03:50 pm, Daniel Caune wrote: > Hi, > > > > I've created a trigger BEFORE INSERT OR UPDATE on a table and, indeed, > when the trigger is raised before insertion the record "old" is not > assigned. Is there a way to distinguish in the trigger procedure from > an insert statement to an update statement? > > > > Regards, > > > > > > -- > > Daniel CAUNE > > Ubisoft Online Technology > > (514) 490 2040 ext. 3613 -- Adrian Klaver aklaver@comcast.net