Skip site navigation (1) Skip section navigation (2)

Re: Failed Statements within Transactions

From: Tim Kientzle <kientzle(at)acm(dot)org>
To: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
Cc: Mike Mascari <mascarm(at)mascari(dot)com>, PostgreSQL general mailing list <pgsql-general(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Failed Statements within Transactions
Date: 2000-12-31 01:11:26
Message-ID: 3A4E87BE.22B46BB5@acm.org (view raw or flat)
Thread:
Lists: pgsql-general
Lincoln Yeoh wrote:
> Also I prefer database errors to be exceptions, not
> something that occurs normally. Maybe I'm strange
> but I dislike the idea of _using_ errors. Seems
> rather kludgy, and hints that there is a design
> issue somewhere.

Unfortunately, in this case, the design issue is in the
SQL language itself which does not provide good support
for this common operation (atomically ensuring that a
unique data item is in a table).  Unfortunately, it's
a little late to change that...  ;-)

An "error" is just a return code that indicates what
happened.  If return codes are well designed, then
they are useful and should be used.  Don't be fooled
by the word "error."  It's only an error if the program
ends up doing the wrong thing.  ;-)

			- Tim

In response to

pgsql-general by date

Next:From: Thomas T. ThaiDate: 2000-12-31 01:57:59
Subject: Re: NetBSD/Alpha and PostgreSQL-current [was Re: NetBSD/Alpha and rkirkpat's patch]
Previous:From: Tom LaneDate: 2000-12-31 01:10:58
Subject: Re: NetBSD/Alpha and PostgreSQL-current [was Re: NetBSD/Alpha and rkirkpat's patch]

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group