Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id AAA34798 for ; Mon, 15 Nov 1999 00:18:47 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id AAA15070; Mon, 15 Nov 1999 00:18:14 -0500 (EST) To: "juman" cc: pgsql-sql@postgreSQL.org Subject: Re: [SQL] Verificate values in other table? In-reply-to: Your message of Sun, 14 Nov 1999 11:25:29 +0100 <000b01bf2e8a$943f3c80$64010a0a@vodka.booze.com> Date: Mon, 15 Nov 1999 00:18:13 -0500 Message-ID: <15068.942643093@sss.pgh.pa.us> From: Tom Lane "juman" writes: > What I want to do is that if someone adds or updates a row in in table2 I > want to verify that the 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