Re: Passing arguments to a function called by a trigger

From: Luca Ferrari <fluca1978(at)infinito(dot)it>
To: Some Developer <someukdeveloper(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Passing arguments to a function called by a trigger
Date: 2013-07-29 08:48:40
Message-ID: CAKoxK+7zCq1WAr2DtkD2WG5waSK1M_HsJkQqPufjJPx_vhxQRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Sat, Jul 27, 2013 at 1:55 PM, Some Developer
<someukdeveloper(at)gmail(dot)com> wrote:
> I have an INSERT AFTER trigger that runs on inserts into a specific table.
> I'm not sure if the function automatically gets all the information that was
> inserted into the table or whether you have to manually pass it in?

You have to read the trigger documentation, as already suggested.
Moreover here (https://github.com/fluca1978/fluca1978-pg-utils/blob/master/bsdmag/03-server-side-programming/03-trigger-download_path-improved.sql)
you can find an example of triggers using also parameters passed at
the creation of the trigger (TG_NARGS, TG_ARGV).

Luca

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message James David Smith 2013-07-29 10:41:50 Re: Fwd: Tricky join and update with same table
Previous Message Luca Ferrari 2013-07-29 06:38:39 Re: Using wildcard for table name ?