X-Original-To: pgsql-interfaces-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id BBD2A9FB256 for ; Wed, 2 Aug 2006 09:55:25 -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 96985-05-2 for ; Wed, 2 Aug 2006 12:55:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id C60EE9FB24C for ; Wed, 2 Aug 2006 09:55:12 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k72Ct7PR014794; Wed, 2 Aug 2006 08:55:09 -0400 (EDT) To: vivek@staff.ownmail.com cc: pgsql-interfaces@postgresql.org Subject: Re: change tuple before insert In-reply-to: <200608021103.k72B3dsU018810@mail009.ownmail.com> References: <200608021103.k72B3dsU018810@mail009.ownmail.com> Comments: In-reply-to message dated "Wed, 02 Aug 2006 16:33:39 +0530" Date: Wed, 02 Aug 2006 08:55:07 -0400 Message-ID: <14793.1154523307@sss.pgh.pa.us> From: Tom Lane 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/5 X-Sequence-Number: 6219 writes: > How do i change the contents of a tuple for a row level trigger? do i have to return tg_trigtuple or tg_newtuple? The doc is confusing. it says a tg_newtuple can only be used in case of an update> You should not scribble on either of those. Make a fresh tuple and return that. regards, tom lane