X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 1368D9FB29B for ; Sun, 3 Sep 2006 20:17:59 -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 82098-10 for ; Sun, 3 Sep 2006 23:17:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.182]) by postgresql.org (Postfix) with ESMTP id 898A99F9B01 for ; Sun, 3 Sep 2006 20:17:55 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id d80so2340007pyd for ; Sun, 03 Sep 2006 16:17:51 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=UHl0J2ggxZdYud/b/yKtiK1J95sK+8O/2kD6qTBrN03brAaHGuxeOJbQBDV+xJVGJC1Mk7Z5EOK+YS73RqSFnRH6VoeOqvm74D7cOXDls5W55ebk/hNfY2yVKUIWpLzc96FRl22OS6yEq2H3SbSEbb9nkpwK3YBF/EqS2hC2FOw= Received: by 10.35.78.9 with SMTP id f9mr8683123pyl; Sun, 03 Sep 2006 16:17:51 -0700 (PDT) Received: by 10.35.80.9 with HTTP; Sun, 3 Sep 2006 16:17:46 -0700 (PDT) Message-ID: Date: Sun, 3 Sep 2006 18:17:46 -0500 From: "Aaron Bono" To: "Ezequias Rodrigues da Rocha" Subject: Re: How to get the row that start a trigger Cc: pgsql-sql@postgresql.org In-Reply-To: <55c095e90608311143q677946by7aa55da061dbbd5a@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_30885_14854690.1157325466420" References: <55c095e90608311143q677946by7aa55da061dbbd5a@mail.gmail.com> X-Google-Sender-Auth: fd51a11acf90be6e X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.696 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, HTML_40_50, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/15 X-Sequence-Number: 26226 ------=_Part_30885_14854690.1157325466420 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/31/06, Ezequias Rodrigues da Rocha wrote: > > Hi, > > I need make a trigger that update a table each time another table has a > insert. but this insert has on this row all the items to pass to my function > on the trigger. > > How to retrieve this information. > See the example at the end of the page http://www.postgresql.org/docs/8.1/interactive/triggers.html - how it uses the OLD and NEW implicit variable. You can use NEW.column_name to access the data being inserted into the table. Does this help? ================================================================== Aaron Bono Aranya Software Technologies, Inc. http://www.aranya.com http://codeelixir.com ================================================================== ------=_Part_30885_14854690.1157325466420 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/31/06, Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> wrote:
Hi,

I need make a trigger that update a table each time another table has a insert. but this insert has on this row all the items to pass to my function on the trigger.

How to retrieve this information.

 
See the example at the end of the page http://www.postgresql.org/docs/8.1/interactive/triggers.html - how it uses the OLD and NEW implicit variable.  You can use NEW.column_name to access the data being inserted into the table.

Does this help?

==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
   http://codeelixir.com
================================================================== ------=_Part_30885_14854690.1157325466420--