Wrong error message in REINDEX command
Hi,
I got wrong error message when I did REINDEX SYSTEM command in
transaction as follows.
It should say "ERROR: REINDEX SYSTEM cannot run inside a transaction block"
Attached patch fixes it.
[postgres][5432](1)=# begin;
BEGIN
[postgres][5432](1)=# reindex system postgres;
ERROR: REINDEX DATABASE cannot run inside a transaction block
STATEMENT: reindex system postgres;
Regards,
-------
Sawada Masahiko
Attachments:
fix_reindex_error_message.patchapplication/octet-stream; name=fix_reindex_error_message.patchDownload
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index daf5326..390d0ea 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -754,7 +754,8 @@ standard_ProcessUtility(Node *parsetree,
*/
PreventTransactionChain(isTopLevel,
(stmt->kind == REINDEX_OBJECT_SCHEMA) ?
- "REINDEX SCHEMA" : "REINDEX DATABASE");
+ "REINDEX SCHEMA" : ((stmt->kind == REINDEX_OBJECT_SYSTEM) ?
+ "REINDEX SYSTEM" : "REINDEX DATABASE"));
ReindexObject(stmt->name, stmt->kind);
break;
default:
Sawada Masahiko <sawada.mshk@gmail.com> writes:
I got wrong error message when I did REINDEX SYSTEM command in
transaction as follows.
It should say "ERROR: REINDEX SYSTEM cannot run inside a transaction block"
Attached patch fixes it.
Hm, yeah, looks like ReindexObject() has a similar disease internally
(not to mention being very inappropriately named itself...)
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers