data integrity and inserts

Поиск
Список
Период
Сортировка
От Scott Frankel
Тема data integrity and inserts
Дата
Msg-id 7097D7C4-43C4-11D9-9E72-000A95A7B782@pacbell.net
обсуждение исходный текст
Ответы Re: data integrity and inserts  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: data integrity and inserts  (Scott Frankel <leknarf@pacbell.net>)
Список 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);


В списке pgsql-general по дате отправления:

Предыдущее
От: "Sally Sally"
Дата:
Сообщение: autocommit and transactions
Следующее
От: "gnari"
Дата:
Сообщение: Re: data integrity and inserts