Re: [PATCHES] Continue transactions after errors in psql
От | Tom Lane |
---|---|
Тема | Re: [PATCHES] Continue transactions after errors in psql |
Дата | |
Msg-id | 24113.1114622200@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: [PATCHES] Continue transactions after errors in psql (Bruce Momjian <pgman@candle.pha.pa.us>) |
Ответы |
Re: [PATCHES] Continue transactions after errors in psql
|
Список | pgsql-hackers |
Bruce Momjian <pgman@candle.pha.pa.us> writes: > Tom Lane wrote: >> Well, that's just a matter of choosing good (ie short) names for the >> backslash commands. I was trying to be clear rather than proposing >> names I would actually want to use ;-). Any suggestions? > Well, if we allowed ON_ERROR_ROLLBACK to work in non-interactive > sessions we could just do: > \set ON_ERROR_ROLLBACK on > DROP TABLE foo; > \set ON_ERROR_ROLLBACK off That isn't the same thing at all. The syntax I was proposing allows the script writer to define a savepoint covering multiple statements, whereas the above does not. Maybe what we really need is a "rollback or release savepoint" operation, defined as "ROLLBACK TO foo if in error state, RELEASE foo if not in error state". This is essentially the thing that a script writer has to have and can't do for himself due to the lack of any conditional ability in psql scripts. We could imagine implementing that either as a SQL command or as a psql backslash command ... I don't have a strong feeling either way. regards, tom lane
В списке pgsql-hackers по дате отправления: