data integrity and inserts

From: Scott Frankel <leknarf(at)pacbell(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: data integrity and inserts
Date: 2004-12-01 18:11:36
Message-ID: 7097D7C4-43C4-11D9-9E72-000A95A7B782@pacbell.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I want to ensure data integrity when inserting into a table, preventing
multiple
entries of identical rows of data.

Does this call for using a trigger?
How would triggers perform a query to test if data already exists in
the table?

(The doco outlines how triggers perform tests on NEW data inserted into
a
table; but I haven't found anything on data already extant.)

Thanks in advance!
Scott

sample table:

CREATE TABLE names (the_id SERIAL PRIMARY KEY, the_name text);

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ian Harding 2004-12-01 18:20:52 Re: data integrity and inserts
Previous Message Sally Sally 2004-12-01 18:09:37 autocommit and transactions