Re: Implicit transaction not rolling back after error
От | Rob Sargent |
---|---|
Тема | Re: Implicit transaction not rolling back after error |
Дата | |
Msg-id | 50D3A1DC.9070403@gmail.com обсуждение исходный текст |
Ответ на | Re: Implicit transaction not rolling back after error (Stephen Touset <stephen.touset@onelogin.com>) |
Ответы |
Re: Implicit transaction not rolling back after error
|
Список | pgsql-general |
On 12/20/2012 04:33 PM, Stephen Touset wrote: > > On Dec 20, 2012, at 3:27 PM, Adrian Klaver <adrian.klaver@gmail.com> wrote: > >> When on (the default), each SQL command is automatically committed upon successful completion. To postpone commit in thismode, you must enter a BEGIN or START TRANSACTION SQL command. When off or unset, SQL commands are not committed untilyou explicitly issue COMMIT or END. The autocommit-off mode works by issuing an implicit BEGIN for you, just beforeany command that is not already in a transaction block and is not itself a BEGIN or other transaction-control command,nor a command that cannot be executed inside a transaction block (such as VACUUM). >> >> Note: In autocommit-off mode, you must explicitly abandon any failed transaction by entering ABORT or ROLLBACK. Also keepin mind that if you exit the session without committing, your work will be lost. >> Note: The autocommit-on mode is PostgreSQL's traditional behavior, but autocommit-off is closer to the SQL spec. If youprefer autocommit-off, you might wish to set it in the system-wide psqlrc file or your ~/.psqlrc file. > > In this case, not only is AUTOCOMMIT set to "on", but I wasn't even able to turn it off for testing purposes. > > test=# SET AUTOCOMMIT TO off; > ERROR: SET AUTOCOMMIT TO OFF is no longer supported > > So yes, AUTOCOMMIT is definitely on. > What does \set show when entered from the psql command line?
В списке pgsql-general по дате отправления: