Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] Trigger

From: Alfred Perlstein <bright(at)wintelcom(dot)net>
To: Raigo Lukk <l950681(at)ttu(dot)ee>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Trigger
Date: 2000-03-07 13:58:34
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
* Raigo Lukk <l950681(at)ttu(dot)ee> [000307 05:36] wrote:
> 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.

I'm pretty new to postgresql as well, but i think what you want to
look at is the RULES section of the documentation, it seems that
would be what you're looking for.

I haven't done it myself, but there's some decent examples there.

-Alfred Perlstein - [bright(at)wintelcom(dot)net|alfred(at)freebsd(dot)org]

In response to

  • Trigger at 2000-03-07 12:54:56 from Raigo Lukk

pgsql-general by date

Next:From: Bruce MomjianDate: 2000-03-07 14:36:02
Subject: Re: [GENERAL] Trigger
Previous:From: Raigo LukkDate: 2000-03-07 13:38:54
Subject: RE: Trigger

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group