Обсуждение: Re: [HACKERS] Savepoints...

Поиск
Список
Период
Сортировка

Re: [HACKERS] Savepoints...

От
Zeugswetter Andreas IZ5
Дата:
Actually, I think a lot of the cases where rollback to savepoint
would be done implicitly could be avoided by adding a fourth
behavior of elog.

This elog, let's e.g. call it elog(WARN,...) would actually behave
like an elog(NOTICE,..) in the backend, but would return ERROR
to the client. I think at least all elogs that happen in the parser
could be handled like this, and a lot of the others.
Of course the client would need an error code, but that is your 
2. item anyway :-)

The following example is IMHO not necessary, 
with or without savepoints:

regression=> begin work;
BEGIN
regression=> insert into t2 values (1, 'one');
INSERT 151498 1
regression=> blabla;
ERROR:  parser: parse error at or near "blabla"
regression=> commit work;    -- actually this is currently a bug,                    -- it must ERROR, since only
rollback work
END                    -- is allowed in txn abort state
regression=> select * from t2;
a|b
-+-
(0 rows)

Andreas