pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: feikesteenbergen@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #10822: "ALTER SYSTEM cannot run inside a transaction block" when having autocommit disabled.
Date: Tue, 01 Jul 2014 09:52:59 +0000
Message-ID: <20140701095259.15695.83780@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (3+ messages)  latest in thread

Message-ID: <20140701095259.15695.83780@wrigleys.postgresql.org>
Permalink:  ../20140701095259.15695.83780@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20140701095259.15695.83780@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: feikesteenbergen@gmail.com
  Subject: Re: BUG #10822: "ALTER SYSTEM cannot run inside a transaction block" when having autocommit disabled.
  In-Reply-To: <20140701095259.15695.83780@wrigleys.postgresql.org>
  References: <20140701095259.15695.83780@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox