Re: Transaction aborts on syntax error.

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: Transaction aborts on syntax error.
Дата
Msg-id 1076613226.10166.217.camel@jester
обсуждение исходный текст
Ответ на Re: Transaction aborts on syntax error.  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
> > >     BEGIN WORK;
> > >     LOCK oldtab;
> > >     CREATE_X TABLE newtab AS SELECT * FROM oldtab;
> > >     DELETE oldtab;
> > >     COMMIT
> > > 
> > > In this case, you would want the database to abort on a syntax error, right?
> > 
> > Certainly not if I was typing this from the command line. Imagine the
> > frustration if the typo was in "DELETE oldtab" and the create statement took
> > hours.
> 
> I suppose we could have a SET that psql could set when it was
> interactive and skip rollback on syntax errors, but that is pretty
> exotic.  Also consider that other errors could abort a query aside from
> syntax errors, like deadlocks.

Can this be done entirely on the client side?

Have psql silently wrap every statement going out with a BEGIN and a
COMMIT or ROLLBACK depending on whether there was an error or not?

It depends on subtransactions but those are bound to appear eventually,
and be infinitely more useful.



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Recursive queries patch
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Make length(char(n)) return 'true' length