Re: Postgres config file: autocommit = off

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Postgres config file: autocommit = off
Дата
Msg-id 11226.1054581085@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Postgres config file: autocommit = off  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Postgres config file: autocommit = off  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> Yeah, it's a bit warty, but psql -c is inherently different from a psql
>> script.  IMHO it's not reasonable to make (shell) scripts using psql -c

> How is it different, except for having no prompt?

It's different because it's explicitly designed for convenient execution
of a single command.  Thus, autocommit off would be useless and
counterproductive.  Also, since the -c string is fed to PQexec as a
single query (again different from the psql stdin behavior), if you do
put multiple commands into -c then you get them executed as a single
transaction anyway.  So you do not need or want .psqlrc modifying the
behavior in either case.

One of the reasons for taking autocommit control out of the backend and
pushing it up to the client level is exactly to make it feasible to take
these sorts of application-level considerations into account when
choosing the behavior.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Postgres config file: autocommit = off
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Postgres config file: autocommit = off