From: | "chris markiewicz" <cmarkiew(at)commnav(dot)com> |
---|---|
To: | "'Postgres \(E-mail\)'" <pgsql-general(at)postgresql(dot)org> |
Subject: | RE: sql/trigger question...arguments? |
Date: | 2000-09-29 21:04:17 |
Message-ID: | 017601c02a58$d5208220$dbb846c6@cmarkiewicz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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(at)hub(dot)org [mailto:pgsql-general-owner(at)hub(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2000-09-29 21:14:32 | Re: Methods in pgsql |
Previous Message | Steve Quezadas | 2000-09-29 20:59:42 | Dropping a field from a table. |