Re: transaction error handling

Поиск
Список
Период
Сортировка
От Kasia Tuszynska
Тема Re: transaction error handling
Дата
Msg-id 232B5217AD58584C87019E8933556D11036BE6ED93@redmx2.esri.com
обсуждение исходный текст
Ответ на Re: transaction error handling  (Walter Hurry <walterhurry@lavabit.com>)
Список pgsql-admin
Hi,
Yes, I believe that you are right.

As far as I can gather, the postgres transaction error handling is like oracle stored procedures. If you do not catch
theerror the whole transaction is rolled back. I am curious why Postgres has gone with a model that does not allow the
usera choice to deal with the statement level errors that may arise in a long transaction. 
 

That either calls for very short transactions or an introduction of explicit savepoint creation and explicit savepoint
destructionfor every statement, if you - the user, want the ability to deal with statement errors that may arise. 
 

I realize that it is almost impossible to change that architecture now, since it would be such a low level change, but
Iam surprised that it is not a common complaint from the user community, since bulk ddl loads would truly suffer. 
 

I do not wish to compare Postgres to Oracle per se, I used oracle because I am more familiar with it than the Sql
Servertransaction model, they did a rewrite on transaction handling for SS 2005 and I never fully got into it. 
 

Sincerely,
Kasia 

-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Walter Hurry
Sent: Tuesday, November 29, 2011 12:50 PM
To: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] transaction error handling

On Tue, 29 Nov 2011 09:57:24 -0800, Kasia Tuszynska wrote:

> Hi Everybody,
> 
> This is an architectural question.
> I am testing on Postgres 9.0.2 on windows and linux(suse, rhel, ubuntu)
> 
> I want to make sure that I have the correct understanding of the
> Postgres architecture and would like to enquire if there are any plans
> to change it.
> 
> Comparing Oracle and Postgres from the perspective of error handling on
> the transaction level I observed the following:
> 
> Oracle:
> Begin transaction Insert - no error Implicit savepoint Insert - error
> raised Implicit rollback to the savepoint, no transaction loss, error
> raised on the insert statement that errored out.
> End transaction, implicit commit, with the single error free insert.
> 
> Postgres:
> Begin transaction Insert - no error Insert - error raised Transaction
> loss = no implicit rollback to the single error free insert.
> 
> Is this a correct interpretation of the Postgres transaction error
> handling?
> If so, are there any changes being considered, or perhaps already
> implemented?

I suspect you may be barking up the wrong tree. Comparing default 
behaviour of PSQL to SQL*Plus is not the same thing as comparing 
PostgreSQL to Oracle.



-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


В списке pgsql-admin по дате отправления:

Предыдущее
От: Walter Hurry
Дата:
Сообщение: Re: transaction error handling
Следующее
От: "Nicholson, Brad (Toronto, ON, CA)"
Дата:
Сообщение: Re: transaction error handling