trigger function with arguments from a sql command

From: "Luis Silva" <lfs12(at)hotmail(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: trigger function with arguments from a sql command
Date: 2005-12-07 15:09:00
Message-ID: BAY18-DAV89A1EC8002779BCE6B68DB5430@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

hi there, i'm having a big problem. I have this table

CREATE TABLE test {

id int8 NOT NULL,
asname varchar(80) NOT NULL,
priority int2 NOT NULL,
serviceid,
...

CONSTRAIN PRIMARY KEY (id),
CONSTRAIN FOREIGN KEY (serviceid) REFERENCES service (id) MATCH FULL
}

and i need to make a trigger function that accept arguments insert in a INSERT INTO. The priority value must be unique for the same serviceid but it can be the same for different serviceid. how can i do that, pass the arguments of a command? tks in advance

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message A. Kretschmer 2005-12-07 15:20:59 Re: trigger function with arguments from a sql command
Previous Message Andreas Seltenreich 2005-12-07 13:53:17 Re: How to see detailed plan of a funciton