Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X1ukS-0006rU-06 for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Jul 2014 09:53:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X1ukR-0008CD-Bh for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Jul 2014 09:53:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X1ukQ-0008C5-AV for pgsql-bugs@postgresql.org; Tue, 01 Jul 2014 09:53:10 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X1ukI-0007va-UQ for pgsql-bugs@postgresql.org; Tue, 01 Jul 2014 09:53:09 +0000 MIME-Version: 1.0 Subject: BUG #10822: "ALTER SYSTEM cannot run inside a transaction block" when having autocommit disabled. To: pgsql-bugs@postgresql.org From: feikesteenbergen@gmail.com Date: Tue, 01 Jul 2014 09:52:59 +0000 Message-ID: <20140701095259.15695.83780@wrigleys.postgresql.org> X-Pg-Spam-Score: -0.3 (/) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 10822 Logged by: Feike Steenbergen Email address: feikesteenbergen@gmail.com PostgreSQL version: 9.4beta1 Operating system: Debian 3.2.57-3+deb7u2 i686 GNU/Linux Description: When having AUTOCOMMIT disabled, issuing an ALTER SYSTEM reports an error. Enabling AUTOCOMMIT makes the issue disappear. $ psql feike feikesuper -h localhost -p 5433 --no-psqlrc psql (9.4beta1) SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256) Type "help" for help. feike=# \set AUTOCOMMIT off feike=# rollback; WARNING: there is no transaction in progress ROLLBACK feike=# ALTER SYSTEM SET log_min_duration_statement = '5s'; ERROR: ALTER SYSTEM cannot run inside a transaction block feike=# rollback; ROLLBACK feike=# \set AUTOCOMMIT on feike=# ALTER SYSTEM SET log_min_duration_statement = '5s'; ALTER SYSTEM The documentation states: "This command is not allowed inside transaction block or function." in my understanding, i am not *yet* inside a transaction block when issuing the ALTER SYSTEM, so I assume it would work when having AUTOCOMMIT enabled, but then after a comleted transaction. To me the current behaviour is odd, as VACUUM, which also mentions "VACUUM cannot be executed inside a transaction block." is able to be executed when having AUTOCOMMIT disabled: $ psql feike feikesuper -h localhost -p 5433 --no-psqlrc psql (9.4beta1) SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256) Type "help" for help. feike=# \set AUTOCOMMIT off feike=# SELECT 1; ?column? ---------- 1 (1 row) feike=# VACUUM; ERROR: VACUUM cannot run inside a transaction block feike=# rollback; ROLLBACK feike=# \set AUTOCOMMIT on feike=# VACUUM; VACUUM -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs