Re: different transaction handling between postgresql and

From: Mike Mascari <mascarm(at)mascari(dot)com>
To: Peter Childs <blue(dot)dragon(at)blueyonder(dot)co(dot)uk>
Cc: Jörg Schulz <jschulz(at)sgbs(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: different transaction handling between postgresql and
Date: 2003-07-14 09:18:48
Message-ID: 3F127578.3090606@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Peter Childs wrote:

> On Mon, 14 Jul 2003, Mike Mascari wrote:
>
>>Jörg Schulz wrote:
>>
>>Presumably Oracle is not rolling back a duplicate key violation,
>>allowing the transaction to continue. This is an often requested
>>feature not present in PostgreSQL.
>
>
> Bug. Not Feature
>
> Transactions must be all or nothing. If one step fails for what
> ever reason all steps must be failed and rolled back. While in this simple
> case ignoring the statment may look fine in more complex examples (where
> the is more data in the table...) this can mean data loss and massive
> problems!

I agree. However a common scenario that has appeared on these lists is
a request for an atomic 'CREATE IF NOT EXISTS, ELSE REPLACE' without
race conditions. Because Oracle doesn't rollback the transaction, it
is implementable in SQL. For PostgreSQL, you either need to use
various locking techniques which reduces concurrency or be prepared to
resubmit the entire transaction. Savepoints and/or nested transactions
may alleviate the situation in the future, however.

Mike Mascari
mascarm(at)mascari(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shridhar Daithankar 2003-07-14 09:31:45 Re: different transaction handling between postgresql and
Previous Message Csaba Nagy 2003-07-14 09:13:39 Re: different transaction handling between postgresql and