pg11b1 from outside a txn: "VACUUM cannot run inside a transaction block": should be: ...or multi-command string

Started by Justin Pryzbyover 7 years ago3 messages
#1Justin Pryzby
pryzby@telsasoft.com

in pg10:

ts=# begin;VACUUM FULL pg_toast.pg_toast_2619;
BEGIN
ERROR: 25001: VACUUM cannot run inside a transaction block
LOCATION: PreventTransactionChain, xact.c:3167
=> sounds fine

$ psql postgres -c 'SELECT 1; VACUUM pg_statistic'
ERROR: VACUUM cannot be executed from a function or multi-command string
=> sounds fine

In pg11b1:

pryzbyj=# begin;VACUUM FULL pg_toast.pg_toast_2619;
BEGIN
ERROR: 25001: VACUUM cannot run inside a transaction block
LOCATION: PreventInTransactionBlock, xact.c:3163
=> sounds fine

[pryzbyj@dev ~]$ psql -c 'SELECT 1; VACUUM pg_statistic'
ERROR: VACUUM cannot run inside a transaction block
=> Error message seems off??

I couldn't figure out how to \set VERBOSITY verbose inside a psql command (??),
but strace shows for v10:
SERROR\0VERROR\0C25001\0MVACUUM cannot be executed from a function or multi-command string\0Fxact.c\0L3187\0RPreventTransactionChain

And for v11:
SERROR\0VERROR\0C25001\0MVACUUM cannot run inside a transaction block\0Fxact.c\0L3163\0RPreventInTransactionBlock

Function renamed by commit 04700b685f31508036456bea4d92533e5ceee9d6.

So behavior change maybe caused by 6eb52da3948dc8bc7c8a61cbacac14823b670c58 ?

Justin

#2Andrew Gierth
andrew@tao11.riddles.org.uk
In reply to: Justin Pryzby (#1)
Re: pg11b1 from outside a txn: "VACUUM cannot run inside a transaction block": should be: ...or multi-command string

"Justin" == Justin Pryzby <pryzby@telsasoft.com> writes:

Justin> I couldn't figure out how to \set VERBOSITY verbose inside a
Justin> psql command (??),

psql -v VERBOSITY=verbose -c 'query here'

--
Andrew (irc:RhodiumToad)

#3Justin Pryzby
pryzby@telsasoft.com
In reply to: Justin Pryzby (#1)
Re: pg11b1 from outside a txn: "VACUUM cannot run inside a transaction block": should be: ...or multi-command string

I'm resending a mail from June:
/messages/by-id/87sh5doya9.fsf@news-spur.riddles.org.uk

This is maybe a trivial change in ERROR string which maybe worth changing.

On PG10:
|[pryzbyj@database ~]$ psql postgres -c 'DROP DATABASE x; CREATE DATABASE x';
|ERROR: DROP DATABASE cannot be executed from a function or multi-command string

On PG11.1:
|[pryzbyj@telsasoft2015 server]$ psql postgres -c 'DROP DATABASE x; CREATE DATABASE x';
|ERROR: DROP DATABASE cannot run inside a transaction block

I spent at least a few minutes trying to do things like: psql -c 'begin;commit;create;drop'
..before figuring it out due to misleading error message, despite having
written this earlier message.

Show quoted text

On Sat, Jun 23, 2018 at 04:06:37PM -0500, Justin Pryzby wrote:

in pg10:

ts=# begin;VACUUM FULL pg_toast.pg_toast_2619;
BEGIN
ERROR: 25001: VACUUM cannot run inside a transaction block
LOCATION: PreventTransactionChain, xact.c:3167
=> sounds fine

$ psql postgres -c 'SELECT 1; VACUUM pg_statistic'
ERROR: VACUUM cannot be executed from a function or multi-command string
=> sounds fine

In pg11b1:

pryzbyj=# begin;VACUUM FULL pg_toast.pg_toast_2619;
BEGIN
ERROR: 25001: VACUUM cannot run inside a transaction block
LOCATION: PreventInTransactionBlock, xact.c:3163
=> sounds fine

[pryzbyj@dev ~]$ psql -c 'SELECT 1; VACUUM pg_statistic'
ERROR: VACUUM cannot run inside a transaction block
=> Error message seems off??

I couldn't figure out how to \set VERBOSITY verbose inside a psql command (??),
but strace shows for v10:
SERROR\0VERROR\0C25001\0MVACUUM cannot be executed from a function or multi-command string\0Fxact.c\0L3187\0RPreventTransactionChain

And for v11:
SERROR\0VERROR\0C25001\0MVACUUM cannot run inside a transaction block\0Fxact.c\0L3163\0RPreventInTransactionBlock

Function renamed by commit 04700b685f31508036456bea4d92533e5ceee9d6.

So behavior change maybe caused by 6eb52da3948dc8bc7c8a61cbacac14823b670c58 ?

Justin