Re: Triggers - Mailing list pgsql-novice

From Josh Berkus
Subject Re: Triggers
Date
Msg-id web-690471@davinci.ethosmedia.com
Whole thread Raw
In response to Triggers  (Rob <rob@obsidian.co.za>)
Responses postmaster start options on RedHat 7.2
List pgsql-novice
Rob,

> I have a trigger on a table called stock_count (which has a column
> barcode) which needs to update a value in a table called
>  theoretical_stock_count on either an insert,
> update or delete.  However, I need to pass the barcode of the
> inserted/updated/deleted row to the function I am calling.  Is there
>  any
> way to do this?

Within the Update or Delete trigger, the bar code of the original row
 is available as OLD.barcode.  For Update and Insert triggers, the new
 record's barcode is available as NEW.barcode.

-Josh

______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco

pgsql-novice by date:

Previous
From: "Christopher A. Goodfellow"
Date:
Subject: [Novice] Create Table
Next
From: Tom Lane
Date:
Subject: Re: C Function Question