Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id EC79047674A for ; Tue, 31 Dec 2002 09:25:43 -0500 (EST) Received: from klaus.sonnenleiter.com (pool-141-153-242-44.mad.east.verizon.net [141.153.242.44]) by postgresql.org (Postfix) with ESMTP id 2F676476790 for ; Tue, 31 Dec 2002 09:24:16 -0500 (EST) Received: from localhost (localhost [[UNIX: localhost]]) by klaus.sonnenleiter.com (8.11.6/8.11.6) id gBV9LUw25119; Tue, 31 Dec 2002 09:21:30 GMT Content-Type: text/plain; charset="iso-8859-1" From: Klaus Sonnenleiter Organization: sonnenleiter.com To: col@mportal.hu, pgsql-admin@postgresql.org Subject: Re: Is there any eqvivalent or alternative to UPDATE(column) or COLUMNS_UPDATED() Date: Tue, 31 Dec 2002 04:21:28 -0500 User-Agent: KMail/1.4.1 References: <000601c1cc18$97f37200$1201a8c0@a4005> In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200212310421.28838.klaus@sonnenleiter.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/337 X-Sequence-Number: 6832 I think the question was how to find out which columns were affected by the update statement. TG_OP will only tell you whether an update fired the trigger. Klaus On Thursday 26 December 2002 03:29, CoL wrote: > http://www.postgresql.org/idocs/index.php?trigger-manager.html > http://www.postgresql.org/idocs/index.php?plpgsql-trigger.html > TG_OP ? > > C. > > shreedhar wrote, On 12/26/2002 12:57 PM: > > Is there any eqvivalent or alternative to the following IF UPDATE(column) > > or IF(COLUMNS_UPDATED()) of SQLServer2000. > > > > IF UPDATE (column) > > > > Tests for an INSERT or UPDATE action to a specified column and is not > > used with DELETE operations. More than one column can be specified. > > Because the table name is specified in the ON clause, do not include the > > table name before the column name in an IF UPDATE clause. To test for an > > INSERT or UPDATE action for more than one column, specify a separate > > UPDATE(column) clause following the first one. IF UPDATE will return the > > TRUE value in INSERT actions because the columns have either explicit > > values or implicit (NULL) values inserted. > > > > IF (COLUMNS_UPDATED()) > > > > Tests, in an INSERT or UPDATE trigger only, whether the mentioned column > > or columns were inserted or updated. COLUMNS_UPDATED returns a varbinary > > bit pattern that indicates which columns in the table were inserted or > > updated. > > > > Thanks And Regards, > > > > Sreedhar > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly