pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: juman <juman@spray.se>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Verificate values in other table?
Date: Mon, 15 Nov 1999 00:18:13 -0500
Message-ID: <15068.942643093@sss.pgh.pa.us> (raw)
In-Reply-To: <000b01bf2e8a$943f3c80$64010a0a@vodka.booze.com>

"juman" <juman@spray.se> writes:
> What I want to do is that if someone adds or updates a row in in table2 I
> want to verify that the <id> given exists in table1.

You can do this with a trigger --- I'd suggest writing it in plpgsql.
No canned example at hand, sorry, but there are examples of triggers
applying error checks in the plpgsql section of the manual.

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <15068.942643093@sss.pgh.pa.us>
Permalink:  ../15068.942643093@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15068.942643093@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, juman@spray.se
  Subject: Re: [SQL] Verificate values in other table?
  In-Reply-To: <15068.942643093@sss.pgh.pa.us>
  References: <000b01bf2e8a$943f3c80$64010a0a@vodka.booze.com> <15068.942643093@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox