From 0ffd155eca7691b16fe799f43a776a7dc59f3b7c Mon Sep 17 00:00:00 2001 From: "Chao Li (Evan)" Date: Fri, 8 May 2026 15:53:23 +0800 Subject: [PATCH v1] Fix wrong error message from pg_get_tablespace_ddl() pg_get_tablespace_ddl_internal() checks ACL_SELECT on the pg_tablespace catalog relation before reading the tablespace tuple. However, when that check failed, it reported the error as permission denied for the specific tablespace object. Report the failure as permission denied for table pg_tablespace instead, matching the object on which the permission check was actually performed. Author: Chao Li --- src/backend/utils/adt/ddlutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/utils/adt/ddlutils.c b/src/backend/utils/adt/ddlutils.c index d6f55c48f37..11bf5ee5836 100644 --- a/src/backend/utils/adt/ddlutils.c +++ b/src/backend/utils/adt/ddlutils.c @@ -681,7 +681,7 @@ pg_get_tablespace_ddl_internal(Oid tsid, bool pretty, bool no_owner) if (pg_class_aclcheck(TableSpaceRelationId, GetUserId(), ACL_SELECT) != ACLCHECK_OK) { ReleaseSysCache(tuple); - aclcheck_error(ACLCHECK_NO_PRIV, OBJECT_TABLESPACE, spcname); + aclcheck_error(ACLCHECK_NO_PRIV, OBJECT_TABLE, "pg_tablespace"); } /* -- 2.50.1 (Apple Git-155)