Re: ALTER TYPE ... ADD VALUE issue

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: ALTER TYPE ... ADD VALUE issue
Date: 2014-10-20 20:28:12
Message-ID: 1413836892168-5823725.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian Klaver-4 wrote
> On 10/20/2014 12:03 PM, Tom Lane wrote:
>> Victor Yegorov &lt;

> vyegorov@

> &gt; writes:
>>> 2014-10-20 21:43 GMT+03:00 Adrian Klaver &lt;

> adrian.klaver@

> &gt;:
>>>> With \set AUTOCOMMIT off the COMMIT ended one transaction block and
>>>> started another.
>>
>>> I don't think `COMMIT` starts a new transaction block here,
>>> as I can run `VACUUM` after it, and vacuum also cannot be run inside
>>> transaction block.
>>
>> psql knows not to issue BEGIN before a VACUUM command. It doesn't
>> know that about ALTER TYPE ... ADD VALUE.
>
> http://www.postgresql.org/docs/9.3/interactive/app-psql.html#APP-PSQL-VARIABLES
>
> AUTOCOMMIT
>
> 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).
>
> The above would seem to imply it should work, in contrast to what I
> originally said.

This complaint already exists as a bug report:

http://www.postgresql.org/message-id/20140930104330.7639.71922@wrigleys.postgresql.org

I would concur that this is an oversight worth correcting going forward; and
I cannot see how it would hurt to back-patch if the fix is reasonably
non-invasive.

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/ALTER-TYPE-ADD-VALUE-issue-tp5823696p5823725.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message nurul [via PostgreSQL] 2014-10-21 07:02:57 Log-shipping replication in one machine
Previous Message Adrian Klaver 2014-10-20 19:26:33 Re: ALTER TYPE ... ADD VALUE issue