Re: undefined behaviour for sub-transactions?

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: undefined behaviour for sub-transactions?
Дата
Msg-id 20051201182150.GA53238@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: undefined behaviour for sub-transactions?  (Greg Stark <gsstark@mit.edu>)
Список pgsql-general
On Thu, Dec 01, 2005 at 01:04:52PM -0500, Greg Stark wrote:
> Where is Postgres at with psql using savepoints implicitly to wrap every
> client command btw? My single biggest pet peeve with Postgres is that setting
> autocommit off in psql is basically unusable because any typo forces you to
> start your transaction all over again.

Are you looking for 8.1's ON_ERROR_ROLLBACK?

test=> \set ON_ERROR_ROLLBACK interactive
test=> begin;
BEGIN
test=> create table foo (x integer);
CREATE TABLE
test=> roeiuqrepuqw;
ERROR:  syntax error at or near "roeiuqrepuqw" at character 1
LINE 1: roeiuqrepuqw;
        ^
test=> insert into foo values (123);
INSERT 0 1
test=> commit;
COMMIT
test=> select * from foo;
  x
-----
 123
(1 row)

--
Michael Fuhr

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

Предыдущее
От: Jaime Casanova
Дата:
Сообщение: Re: Question
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: 8.1, OID's and plpgsql