Re: Passing arguments to a function called by a trigger

From: Some Developer <someukdeveloper(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Passing arguments to a function called by a trigger
Date: 2013-07-27 12:15:47
Message-ID: 51F3B9F3.9070405@googlemail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 27/07/2013 14:05, Andreas Kretschmer wrote:
> 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?
>
> NEW.<colum_name> is your friend ;-)
>
>
> Andreas
>

Thanks for the tip. So I can just use NEW.<whatever> to get the values
inserted into the table from inside the function that is called by the
trigger?

Is there a corresponding OLD as well if I ever want to do a trigger on
an UPDATE?

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Andreas Kretschmer 2013-07-27 13:05:39 Re: Passing arguments to a function called by a trigger
Previous Message Some Developer 2013-07-27 11:55:25 Passing arguments to a function called by a trigger