Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sysOE-002mKB-Q5 for pgsql-general@arkaria.postgresql.org; Thu, 10 Oct 2024 12:35:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sysOD-00HJK9-K4 for pgsql-general@arkaria.postgresql.org; Thu, 10 Oct 2024 12:35:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sysOD-00HJK0-8W for pgsql-general@lists.postgresql.org; Thu, 10 Oct 2024 12:35:33 +0000 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sysOA-000LGL-5X for pgsql-general@lists.postgresql.org; Thu, 10 Oct 2024 12:35:32 +0000 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-710e01dd554so495395a34.3 for ; Thu, 10 Oct 2024 05:35:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728563729; x=1729168529; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=J6itLqcA3IFm9JogUhxOCBm9UNThSvPC23axfADIcsY=; b=Mf6jIR2XFgJKs6aUlzRPtfkrYNNhtjiDQkFBlHWKdj3DlXxCOQy64YYKePhtTfXoJf ZS7n8O9c7YOpHRYgdIgg8uKIblOvxglX487vh6fg8Obz8XStexj7+B4lPz7b6skNifjs O61TpZUPDNkygx/i+UiuxBI5L3tEsOj/329wHujf146rDt1wCnrFtxFZZHD7gGRdvbNK 0P5C9v+k6tK/ncuVqFV4vN+8VdWlPiV7eaRT1EUDx5IuPxtv90E5UedbOvMrPR+QorP3 jHHnqjNc3PlIrbdU9dKbK89myqn5skdxDe2dPjWOK+eN6kSEPxk1P9dK1W0Hh1maFU72 lR0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728563729; x=1729168529; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=J6itLqcA3IFm9JogUhxOCBm9UNThSvPC23axfADIcsY=; b=R7bgmGEVzQCSiZiIBCVNADqQTSymcCb/ldOxP41J5cv8KL6ioX5Pk3xWe99gSCAser uVxkplNrgwQLrtmNdwq5yzG85OPnmMwhXxvCrE4kVAJFVpYsd9GEFl4rRse+fW5ETOV8 J+1nCsskZGLfelKnOlz5HYPL5YOHFCFMF/S2tZp2vcfgnHiRtws5mnBI0QsFICOMHZkf hpwEfJOJmkERaUPJWA5hIycn11Okvgj898QKZsj0TDK1XqNccUR4RAW0wkM6mcRp15Ev G8mOC79AVBLu+fwiOQFlrFsL7bsf01pphHefo9iP/Ev+cj/mD010DEp3CdRxcX9khocJ blcQ== X-Gm-Message-State: AOJu0Yzj/PgssjYEA8ffRhDTJ+Oo8tb8WIdrmJFDQ/OksNfbF1PkjTN0 qHgtFqLVRZURttIZ/ZdzQSAf5MEj1JYqMV2IqWA3/IZbLsunI2mba+7esxSu5921HHJZ6Ov92Iu S2WUY+R21II6IBfuuzgpzWTZKnR34flE6 X-Google-Smtp-Source: AGHT+IHNXmwego7tdzi/llkeSvL21NsfVL6sCgr8uxwJEM7duqHu8pPaOVpBWgfHavPXEG4VWgfEgV+H59erbbeGpR8= X-Received: by 2002:a05:6871:3423:b0:287:541:c60 with SMTP id 586e51a60fabf-28834265deemr4421888fac.1.1728563728968; Thu, 10 Oct 2024 05:35:28 -0700 (PDT) MIME-Version: 1.0 From: Dominique Devienne Date: Thu, 10 Oct 2024 14:35:17 +0200 Message-ID: Subject: Tablespace ACLs To: pgsql-general@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi. Why isn't the ::regrole::text cast working as usual? Aren't the OIDs for grantor and grantee returned by acldefault() valid ROLEs? C:\Users\ddevienne>psql service=... psql (17.0) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: postgresql) Type "help" for help. ddevienne=> show server_version; server_version ---------------- 17.0 (1 row) ddevienne=> select grantor::regrole::text, ddevienne-> case when grantee = 0 then 'PUBLIC' else grantee::regrole::text end, ddevienne-> privilege_type, is_grantable ddevienne-> from pg_tablespace ddevienne-> left join lateral aclexplode(coalesce(spcacl, acldefault('t', oid))) on true ddevienne-> where spcname = 'pg_default'; grantor | grantee | privilege_type | is_grantable ---------+---------+----------------+-------------- 1663 | 1663 | CREATE | f (1 row) ddevienne=> select grantor::regrole::text, ddevienne-> case when grantee = 0 then 'PUBLIC' else grantee::regrole::text end, ddevienne-> privilege_type, is_grantable ddevienne-> from pg_tablespace ddevienne-> left join lateral aclexplode(coalesce(spcacl, acldefault('t', oid))) on true ddevienne-> where spcname = 'hdd_data'; grantor | grantee | privilege_type | is_grantable ---------+---------+----------------+-------------- 2128194 | 2128194 | CREATE | f (1 row) On a related but different matter, is it normal not having access to a single tablespace makes the whole output disappear? ddevienne=> \db+ ERROR: permission denied for tablespace hdd_data ddevienne=> \c - postgres ddevienne=# \db+ List of tablespaces Name | Owner | Location | Access privileges | Options | Size | Description ------------+----------+----------------+-------------------+---------+---------+------------- hdd_data | postgres | ... | | | 0 bytes | pg_default | postgres | | | | 1077 MB | pg_global | postgres | | | | 6301 kB | (3 rows)