Re: Errors attempting to insert duplicate values

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Errors attempting to insert duplicate values
Дата
Msg-id 393D0881.50782DB1@cupid.suninternet.com
обсуждение исходный текст
Ответ на Errors attempting to insert duplicate values  ("Bryan White" <bryan@arcamax.com>)
Список pgsql-general
Bryan White wrote:
>
> I have a table with a unique index.  When I go to insert a new value into
> the table my code does not know if the record is already there.  To me there
> are two choices:
>
> 1) Do a select for the record and insert only if not found.
>
> 2) Do a blind insert and relay on the unique index to fail the insert if
> there is a duplicate.

3) Use a sequence to generate unique indicies for you?
--
Martijn van Oosterhout <kleptog@cupid.suninternet.com>
http://cupid.suninternet.com/~kleptog/

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

Предыдущее
От: Ed Loehr
Дата:
Сообщение: Re: Vacuum Question
Следующее
От: Patrick Welche
Дата:
Сообщение: Re: 32KB Tuples