Re: Failed Statements within Transactions

Поиск
Список
Период
Сортировка
От Tim Kientzle
Тема Re: Failed Statements within Transactions
Дата
Msg-id 3A4E87BE.22B46BB5@acm.org
обсуждение исходный текст
Ответ на Re: Failed Statements within Transactions  (Tim Kientzle <kientzle@acm.org>)
Список 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 по дате отправления:

Предыдущее
От: Franck Martin
Дата:
Сообщение: new geoobj type in PG.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: How do we use classes as types?