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.96) (envelope-from ) id 1w4XPP-002IAf-2Z for pgsql-admin@arkaria.postgresql.org; Mon, 23 Mar 2026 05:00:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w4XPM-00FOo8-1l for pgsql-admin@arkaria.postgresql.org; Mon, 23 Mar 2026 05:00:56 +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.96) (envelope-from ) id 1w4XPM-00FOnz-0V for pgsql-admin@lists.postgresql.org; Mon, 23 Mar 2026 05:00:56 +0000 Received: from mail-dy1-x132d.google.com ([2607:f8b0:4864:20::132d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w4XPJ-00000000bKo-3PiA for pgsql-admin@lists.postgresql.org; Mon, 23 Mar 2026 05:00:56 +0000 Received: by mail-dy1-x132d.google.com with SMTP id 5a478bee46e88-2c0ea57fea7so4447580eec.0 for ; Sun, 22 Mar 2026 22:00:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774242052; cv=none; d=google.com; s=arc-20240605; b=fUjccfL/JQeMT1eMxKBIZuDTWC0jSlaa5lMJ4jkAdKy5lLtBeysd+Eac3SraNu9wdO VYn7zk8H3MwyH8EHMquTml738z7vIxNsy4WclZHJYrx/tShLnjxY0cSqRbhlHbl84B/3 B7pkJHG1IoMR2kepGkkQt/Xvd6KCXkERzLBktdd/JQwnwtttfQAdfmxomsWNe9erMrhf BddTtXE3C9pK/xZOijg/2eEIFBxjNN1Qzuy9rlj1uTjyp5e/qaLOl8iAz0M7WSWnAjtc CeP5A9UEW0wiPtqJzI7fZxxG1vod7XtYuHm6df3C7vGAKS52SDFS1aEzXObMcVbpF+5A hD8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=s3uaipi7x2Hh+iY5oLzKyYSqYwDS3tAkhUK7ixw+7ZI=; fh=druxZHa2fk4e6MLibibygn9AWWgeaAPo4m8Gpo2MBXU=; b=S8JfOl1TWRnK4BjT9Kdm8jZRHX0LsACAHRc0GXeTgJ2kBas5Ea6xuzJUw71TfSAOg4 9qFL/VviatQdItir0C5TARZb49mNc5P9Zyhzt90iXEVPprUcTtmieOXput26S1a+FCRS nKvWSgt7tFDisqrySprP6Xn6+u/HzOHwDXJPjvtJ1rSuS2QLB9jlWOQU+DJadiSeKzdF zsUKb4uideTYHuB9d8+tYDA8MIcJOmBYQuvBw0FtITkxsEjAyL5NjyTRk/FErQI/HtW4 F60gbAj65W8CuKkqSVS/XA9Eydh4mEvEZAMvuvJ3QAEK9OQtcCDe0njUbo6SY4BLRBiv AzFg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774242052; x=1774846852; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=s3uaipi7x2Hh+iY5oLzKyYSqYwDS3tAkhUK7ixw+7ZI=; b=kujbgl9d6W2Jjyhq1Uc0FzSzwxZEUxekNdgOh5Mu4knOQr5jwvu1cBUSmPVCA3Yadx IAPUOcAO0mkhOcD7Y/ny0xM+PTW7zXieSQB81SwCu/N9rzSz+YvZjLIKDbgPL6ZocybS k+iPVs8vhTZjJgJp7zMIt6W6fxHQ8wU7zPnaH0ZexNsDNazVLLtjz9b4d9/n+fLwygcm +iOYc84iAE3ABf4nAu6INv01gyNthkbD7JRxzA6JTmqNEkxtv+Ac0RhhEYGqW8kXxrnu FxizNKm+bXEJ0itYDQOetzHfEkr0kiIcPVKbiVWYKBloMMhryYjyh3wpKz1oCVmSBPyX aKww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774242052; x=1774846852; h=to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=s3uaipi7x2Hh+iY5oLzKyYSqYwDS3tAkhUK7ixw+7ZI=; b=KqbnbJIna6WZfyVUtjGfK+awKr5B+fcO1JhGWsoHsXP0ezyvqYb4oBoUkxRV555jIf YJWsiFXMShirvpxUHq3b8CQXM0Jt/KOBV2NGV9t8BLi6l46pYGPVjWckEabbH4rOu4ks 3Zl7xgpOEtho/zWFbiluWNtNMAm2/ze5YtJNqPDmDytwgDYJO3Wq+cTcFe8YDt1LHBrp CuMBeTW7cOqKFJYbXIDEFdqNpj9qgeQEKhgHRXqGsC3F4pzLP7kVS4rjp6RRwIoYDaXj 9MaBjMykhI+QBBrjmVs7yOiM7HkcYkCog+B1WJbS5LEjnPWMrE1wxUEAhrE7kUWAH6LC jPDA== X-Gm-Message-State: AOJu0YxgfRNwWzFgGzqTgajM1/Euu7yxoTkJtvunB7xHqxIXsMrRIP8l ICiGmjJun5+CRNRmIayz8r6hl8mhrxFZ8aaR918gWTN55n99g5U3ET/HoGVtrCYvsdDG1ToMjs4 whmMxskeOvIeSaw99SYmoAxktz6gOFxnGYXi8O2al/A== X-Gm-Gg: ATEYQzzwo3VoIfCUAr0ygxp6qrc7tSMVdH9Ct/ILFdPkUIQSth6ArXwocs8pAbl5fnv tzktA4jspb7DtGbut4jQjPps8ZljJRfYIiDC7Yit3TWi4n9PCW33kBpjz7qcjk9GNp2H7ZXeh9E nu67AA0bF2KyRTbFQdYz2JJ6Sc7QBDIWo+BJvfU2TSZ5ZMcXQspIALIiUNjRoIDaFhlpvKl7QyV quAibo5sWHwXV1oTTP1M1xZgT8Rz/VzqiF6yukYQ0g8kcWHzdf4xJCfHS+wsm7RrJ+nfOoyGBIP oI8sDRHb/z8MrLCSwySM3RPD2Y5vfsCrD+e7jbQ= X-Received: by 2002:a05:693c:2c0f:b0:2b8:26b8:3446 with SMTP id 5a478bee46e88-2c1095a75e9mr4118387eec.2.1774242051532; Sun, 22 Mar 2026 22:00:51 -0700 (PDT) MIME-Version: 1.0 From: Edwin UY Date: Mon, 23 Mar 2026 18:00:14 +1300 X-Gm-Features: AQROBzBV0OKcP-oHo-UNI9d410y5Zm1UD00VGwfLBjvvtHnat4r3nlmPqUXk0PE Message-ID: Subject: Is the resultset from these queries has_table_privilege and information_schema.role_table_grants supposed to match? To: Pgsql-admin Content-Type: multipart/alternative; boundary="0000000000003a2b38064da9ebf6" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000003a2b38064da9ebf6 Content-Type: text/plain; charset="UTF-8" Hi, Is the resultset from these queries has_table_privilege and information_schema.role_table_grants supposed to match? blahp1_abc_update is a role User patrick has been granted the blahp1_abc_update role Shouldn't blahp1_abc_update appear in the query from information_schema.role_table_grant. information_schema.role_table_grant.shows nothing for table_name = 'job_requests' blahp1=> blahp1=> select tablename, schemaname, has_table_privilege('blahp1_abc_update', schemaname || '.' || tablename, 'SELECT') SELECT from pg_tables where tablename = 'job_requests' ; tablename | schemaname | select --------------+------------+-------- job_requests | blah | f job_requests | blahp1_abc | t (2 rows) blahp1=> SELECT grantee, privilege_type, table_name FROM information_schema.role_table_grants WHERE table_schema = 'blahp1_abc' ; grantee | privilege_type | table_name ---------+----------------+------------ (0 rows) blahp1=> blahp1=> blahp1=> select table_name, table_schema from information_schema.role_table_grants where table_name = 'job_requests' ; table_name | table_schema ------------+-------------- (0 rows) blahp1=> blahp1=> select tablename, schemaname, has_table_privilege('patrick', schemaname || '.' || tablename, 'SELECT') SELECT from pg_tables where tablename = 'job_requests' ; tablename | schemaname | select --------------+------------+-------- job_requests | blah | f job_requests | blahp1_abc | t (2 rows) Regards, Pat --0000000000003a2b38064da9ebf6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

Is the resultset from these queries has_table_= privilege and information_schema.role_table_grants supposed to match?
blahp1_abc_update is a role
User patrick has been granted=C2=A0the=C2=A0 blahp1_abc_update role
Shouldn't=C2=A0 blahp1_abc_update appear=C2=A0in the query from information_schema.role_tab= le_grant.
information_schema.role_table_grant.shows nothing for table_name =3D 'j= ob_requests'
blahp1=3D>
blahp1= =3D> select tablename, schemaname,
=C2=A0 has_table_privilege('bl= ahp1_abc_update', schemaname || '.' || tablename, 'SELECT&#= 39;) SELECT
from pg_tables
where tablename =3D 'job_requests'= ;
=C2=A0 tablename =C2=A0 | schemaname | select
--------------+-----= -------+--------
=C2=A0job_requests | blah =C2=A0 =C2=A0 =C2=A0 =C2=A0| = f
=C2=A0job_requests | blahp1_abc =C2=A0| t
(2 rows)

blahp1=3D= > SELECT grantee, privilege_type, table_name
FROM information_schema.= role_table_grants
WHERE table_schema =3D 'blahp1_abc'
;
= =C2=A0grantee | privilege_type | table_name
---------+----------------+-= -----------
(0 rows)

blahp1=3D>
blahp1=3D>
blahp1=3D&= gt; select table_name, table_schema from information_schema.role_table_gran= ts where table_name =3D 'job_requests' ;
=C2=A0table_name | tabl= e_schema
------------+--------------
(0 rows)

blahp1=3D>blahp1=3D> select tablename, schemaname,
=C2=A0 has_table_privilege(= 'patrick', schemaname || '.' || tablename, 'SELECT'= ) SELECT
from pg_tables
where tablename =3D 'job_requests' ;<= br>=C2=A0 tablename =C2=A0 | schemaname | select
--------------+--------= ----+--------
=C2=A0job_requests | blah =C2=A0 =C2=A0 =C2=A0 | f
=C2= =A0job_requests | blahp1_abc | t
(2 rows)


Regards,
Pat


--0000000000003a2b38064da9ebf6--