Verificate values in other table? - Mailing list pgsql-sql

From juman
Subject Verificate values in other table?
Date
Msg-id 000b01bf2e8a$943f3c80$64010a0a@vodka.booze.com
Whole thread Raw
Responses Re: [SQL] Verificate values in other table?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [SQL] Verificate values in other table?  (Peter Eisentraut <peter_e@gmx.net>)
List 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



pgsql-sql by date:

Previous
From: "Artur Kokoszka"
Date:
Subject: national characters in plpgsql
Next
From: Chaotic Inceptions
Date:
Subject: Arrays of composites, bug or usage?