Re: Errors attempting to insert duplicate values

From: Martijn van Oosterhout <kleptog(at)cupid(dot)suninternet(dot)com>
To: Bryan White <bryan(at)arcamax(dot)com>
Cc: pgsql-general <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: Errors attempting to insert duplicate values
Date: 2000-06-06 14:19:45
Message-ID: 393D0881.50782DB1@cupid.suninternet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)cupid(dot)suninternet(dot)com>
http://cupid.suninternet.com/~kleptog/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Patrick Welche 2000-06-06 14:22:54 Re: 32KB Tuples
Previous Message Ed Loehr 2000-06-06 14:17:40 Re: Vacuum Question