Trigger - Mailing list pgsql-general

From Raigo Lukk
Subject Trigger
Date
Msg-id Pine.GSO.4.10.10003071450330.874-100000@elo.va.ttu.ee
Whole thread Raw
Responses Re: [GENERAL] Trigger
List pgsql-general
Hi

I am trying to create a trigger for a detail table to check that value
what is entered exists in master table.
For example into CustomerOrder table could not be enterd order for
Customer what does not exists.

How is it best done in PostgreSQL?

I believe a trigger is what I must do.
I looked the documentation in the part of triggers and there was an
trigger example what had a part:
execute procedure procedurename
Does this mean that I should create a procedure for each trigger?
Going further I found no Create Procedure in the documentation ... so
 how to create procedures in PostgreSQL?


Maybe, somebody could send me some example trigger for checking detail
record value's existance in master table.

Sorry, for simple question, but I just started using PostgreSQL.


Thanks
Raigo
raigo.lukk@ttu.ee


pgsql-general by date:

Previous
From: Raigo Lukk
Date:
Subject: Trigger
Next
From: Andrzej Mazurkiewicz
Date:
Subject: RE: [GENERAL] Trigger