hello.
this is a follow-up to my previous question (shown below). i want to do the
following...when a row is inserted into my PERSON table, i want to add a row
to the RESOURCE table. i checked the documentation and tried many
things...none seem to work.
questions:
1. can a postgres trigger contain a insert/select/update/delete statement or
can it contain only a function call?
2. my procedure, if i have to write one, does not return anything. how do i
handle that in the RETURNS clause? if i tell it to return, for example, an
int4, then try to create my trigger, it tells me that the sp has to return a
value of type OPAQUE.
3. back to the original question, how do i pass variables? is it the
:new.PersonID notation?
thanks a lot.
chris
-----Original Message-----
From: pgsql-general-owner@hub.org [mailto:pgsql-general-owner@hub.org]On
Behalf Of chris markiewicz
Sent: Friday, September 29, 2000 2:48 PM
To: Postgres (E-mail)
Subject: [GENERAL] sql/trigger question...arguments?
hello.
i am new to triggers. i am trying to write one that inserts a row into a
table (RESOURCE) everytime a new person (PERSON) is added to my db. the
problem is that i want to include some data from the PERSON insert in the
RESOURCE insert. (for example, the value of the PersonID field will be
entered into the ResourceID field.) how do i pass info to a trigger?
thanks
chris