Re: AW: AW: [HACKERS] TRANSACTIONS

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>, "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "'hackers'" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: AW: AW: [HACKERS] TRANSACTIONS
Date: 2000-02-24 14:19:20
Message-ID: 3.0.1.32.20000224061920.01715af0@mail.pacifier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 10:04 AM 2/24/00 +0100, Zeugswetter Andreas SB wrote:
>
>> > In this sense a commit is not partial. The commit should commit
>> > all statements that were not in error.
>>
>> That interpretation eliminates an absolutely essential capability
>> (all-or-none behavior) in favor of what strikes me as a very minor
>> programming shortcut.
>
>The all-or-none behavior is what you get if you simply do a rollback
>on any error or warning. I don't see a special programming difficulty here.

Unfortunately (for the current implementation of Postgres) I've come
to the conclusion that this is indeed what standard SQL specifies.

It is up to the application or user to rollback the entire transaction
if that's the behavior that's desired.

Of course the whole concept of an explicit "begin" is non-standard,
too. In SQL you're always in a transaction, commit and rollback
terminate transactions and start a new one. Oracle, at least, provides
a "autocommit" mode (which works like Postgres when you're outside a
begin/commit block).

I suspect that most applications don't notice the difference. Most
will catch errors and roll back the current transaction, because that's
the logical thing to do in most cases.

- Don Baccus, Portland OR <dhogaza(at)pacifier(dot)com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-02-24 14:22:42 Re: [HACKERS] Re: [BUGS] First experiences with Postgresql 7.0
Previous Message Peter Eisentraut 2000-02-24 13:58:23 Re: [BUGS] First experiences with Postgresql 7.0