Verificate values in other table?

From: "juman" <juman(at)spray(dot)se>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Verificate values in other table?
Date: 1999-11-14 10:25:29
Message-ID: 000b01bf2e8a$943f3c80$64010a0a@vodka.booze.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I'm working on a little database and got stuck with the following problem. I
have two tables that look like this

table1 ( ids char(4) )
table2 ( id char(4), comment text)

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. And if it doesn't don't
accept the modification and give the user a error message. Is there some way
to do this?

/ Fredrik

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Eisentraut 1999-11-14 18:44:52 Re: [SQL] Verificate values in other table?
Previous Message Artur Kokoszka 1999-11-13 22:30:35 national characters in plpgsql