Hi all, Lately I have come across two inconveniences/bugs related to running the autocommit-off mode in psql.
These are: - BUG #11524: Unable to add value to ENUM when having AUTOCOMMIT disabled in psql - BUG #10822: "ALTER SYSTEM cannot run inside a transaction block" when having autocommit disabled. The documentation states about autocommit-off in http://www.postgresql.org/docs/devel/static/app-psql.html : The autocommit-off mode works by issuing an implicit BEGIN for you, just before any 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). In src/bin/psql/common.c the statements which should not start a transaction implicitly are filtered in command_no_begin. I would like to propose to add a regression test for all statements that call PreventTransactionChain in autocommit-off mode. I propose to add these tests to src/test/regress/sql/psql.sql as this is a psql-specific mode. Alternatively an isolated test called autocommit.sql could be created. During the writing of the regression test I found another statement not covered in the current function: DROP INDEX CONCURRENTLY. After applying this patch, the only command that I can find currently which cannot be executed inside a transaction block and is currently not able to be run in autocommit-off is "ALTER TYPE name ADD VALUE"; I have created a patch consisting of a regression test and adding DROP INDEX CONCURRENTLY to command_no_begin. Kind regards, Feike Steenbergen
20141006_autocommit-off_regression.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers