BUG #11524: Unable to add value to ENUM when having AUTOCOMMIT disabled in psql

From: feikesteenbergen(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #11524: Unable to add value to ENUM when having AUTOCOMMIT disabled in psql
Date: 2014-09-30 10:43:30
Message-ID: 20140930104330.7639.71922@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 11524
Logged by: Feike Steenbergen
Email address: feikesteenbergen(at)gmail(dot)com
PostgreSQL version: 9.4beta2
Operating system: Debian
Description:

If I want to add a value to an ENUM type, I cannot do so when having
AUTOCOMMIT enabled.

To reproduce:
\set ECHO queries
CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');
ALTER TYPE mood ADD VALUE 'autocommit enabled';
\set AUTOCOMMIT OFF
ALTER TYPE mood ADD VALUE 'autocommit disabled';

Output:
CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');
CREATE TYPE
ALTER TYPE mood ADD VALUE 'autocommit enabled';
ALTER TYPE
ALTER TYPE mood ADD VALUE 'autocommit disabled';
psql:autocommit_enum.sql:5: ERROR: ALTER TYPE ... ADD cannot run inside a
transaction block

I have this issue on 9.1 - 9.5. (This issue does not occur on 9.0 as adding
"ADD VALUE" was added in 9.1).

This bug reminds me of:
BUG #10822: "ALTER SYSTEM cannot run inside a transaction block" when having
autocommit disabled.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tomas Vondra 2014-09-30 11:02:02 Re: BUG #11524: Unable to add value to ENUM when having AUTOCOMMIT disabled in psql
Previous Message dmigowski 2014-09-30 09:56:25 BUG #11523: Regular expressions work differently on different platforms