Re: Failed Statements within Transactions - Mailing list pgsql-general

From Tim Kientzle
Subject Re: Failed Statements within Transactions
Date
Msg-id 3A4E87BE.22B46BB5@acm.org
Whole thread Raw
In response to Re: Failed Statements within Transactions  (Tim Kientzle <kientzle@acm.org>)
List 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

pgsql-general by date:

Previous
From: Franck Martin
Date:
Subject: new geoobj type in PG.
Next
From: Tom Lane
Date:
Subject: Re: How do we use classes as types?