Adrian Klaver-4 wrote
> On 10/20/2014 12:03 PM, Tom Lane wrote:
>> Victor Yegorov <
> vyegorov@
> > writes:
>>> 2014-10-20 21:43 GMT+03:00 Adrian Klaver <
> adrian.klaver@
> >:
>>>> 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.