Re: Abort state on duplicated PKey in transactions

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Haroldo Stenger <hstenger(at)adinet(dot)com(dot)uy>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Abort state on duplicated PKey in transactions
Date: 2001-09-08 09:08:18
Message-ID: 20010908190818.D17777@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Sep 07, 2001 at 04:29:45PM -0500, Haroldo Stenger wrote:
> I'm aware that savepoints and nested transactions will be implemented in
> future versions, but how to solve the problem before that starts
> working?

The usual way is to generate your primarys keys from a sequence. Then you
never get duplicate values and so the inserts never fail.

This may not apply in your situation...
--
Martijn van Oosterhout <kleptog(at)svana(dot)org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2001-09-08 10:28:42 Re: Uniquely identify a connection?
Previous Message Martijn van Oosterhout 2001-09-08 09:01:00 Re: Problem w/ dumping huge table and no disk space