pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: transaction
Date: Wed, 21 Apr 2004 06:13:27 -0400
Message-ID: <20040421101327.GA31729@phlogiston.dyndns.org> (raw)
In-Reply-To: <KIEBKBGIGGNDKKJJNKCFOELJCJAA.hjs@worldonline.nl>
References: <KIEBKBGIGGNDKKJJNKCFOELJCJAA.hjs@worldonline.nl>

On Tue, Apr 20, 2004 at 09:14:48PM +0200, H.J. Sanders wrote:
> 
> - BEGIN WORK
> 
> - INSERT ROW
> 
> - IF FAILED THEN UPDATE ROW
> 
> - COMMIT WORK

You can do it the other way.  Begin, update; if 0 rows are updated
then insert.

A
-- 
Andrew Sullivan  | ajs@crankycanuck.ca



view thread (5+ messages)  latest in thread

Message-ID: <20040421101327.GA31729@phlogiston.dyndns.org>
Permalink:  ../20040421101327.GA31729@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20040421101327.GA31729@phlogiston.dyndns.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ajs@crankycanuck.ca
  Subject: Re: transaction
  In-Reply-To: <20040421101327.GA31729@phlogiston.dyndns.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox