Re: mysql replace in postgreSQL?

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: David Fetter <david(at)fetter(dot)org>
Cc: blackwater dev <blackwaterdev(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: mysql replace in postgreSQL?
Date: 2005-11-02 07:06:27
Message-ID: 1130915187.30174.15.camel@Andrea.peacock.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Am Sonntag, den 30.10.2005, 07:24 -0800 schrieb David Fetter:
...
> > In most cases, just DELETE and then INSERT should work perfectly.
> > (UPDATE and MERGE would cause dead tuples in the same way so in the
> > end they are only syntactical sugar)
> >
> > Another way is a rule for insert which turns it into an update in
> > case the desired tuple is already existent.
>
> That has a race condition in it. What happens if something deletes
> the tuple between the attempted INSERT and the UPDATE?

How so in a transaction?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guy Rouillier 2005-11-02 07:27:02 Re: PostgreSQL on 64-bit operating systems
Previous Message Mike Shelton 2005-11-02 06:33:39 Backend connection pooling memleak