agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: psql: Allow pg_read_all_stats to see database size in \l+
7+ messages / 1 participants
[nested] [flat]

* pgsql: psql: Allow pg_read_all_stats to see database size in \l+
@ 2026-07-25 10:12 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Fujii Masao @ 2026-07-25 10:12 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Allow pg_read_all_stats to see database size in \l+

pg_database_size() allows access to users who have either CONNECT
privilege on the target database or privileges of the pg_read_all_stats
role. However, previously, psql's \l+ checked only for CONNECT,
so users with privileges of pg_read_all_stats still saw "No Access" for
databases they could not connect to.

Fix this by making \l+ also check
pg_has_role('pg_read_all_stats', 'USAGE'), matching
pg_database_size()'s permission rules.

For back branches, emit the pg_read_all_stats check only when
connected to PostgreSQL 10 or later, since earlier releases do not have
that predefined role.

Backpatch to all supported versions.

Author: Christoph Berg <myon@debian.org>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/amCo6qRmnfPVk4-V@msg.df7cb.de
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/38afc3dcb25c45b744d4025029ce0a6c90b7059f

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 5 +++--
src/bin/psql/describe.c        | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: psql: Allow pg_read_all_stats to see database size in \l+
@ 2026-07-25 10:12 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Fujii Masao @ 2026-07-25 10:12 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Allow pg_read_all_stats to see database size in \l+

pg_database_size() allows access to users who have either CONNECT
privilege on the target database or privileges of the pg_read_all_stats
role. However, previously, psql's \l+ checked only for CONNECT,
so users with privileges of pg_read_all_stats still saw "No Access" for
databases they could not connect to.

Fix this by making \l+ also check
pg_has_role('pg_read_all_stats', 'USAGE'), matching
pg_database_size()'s permission rules.

For back branches, emit the pg_read_all_stats check only when
connected to PostgreSQL 10 or later, since earlier releases do not have
that predefined role.

Backpatch to all supported versions.

Author: Christoph Berg <myon@debian.org>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/amCo6qRmnfPVk4-V@msg.df7cb.de
Backpatch-through: 14

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/77aeca80249c9e640c811e80633a2e334a9320de

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 5 +++--
src/bin/psql/describe.c        | 4 ++++
2 files changed, 7 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: psql: Allow pg_read_all_stats to see database size in \l+
@ 2026-07-25 10:13 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Fujii Masao @ 2026-07-25 10:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Allow pg_read_all_stats to see database size in \l+

pg_database_size() allows access to users who have either CONNECT
privilege on the target database or privileges of the pg_read_all_stats
role. However, previously, psql's \l+ checked only for CONNECT,
so users with privileges of pg_read_all_stats still saw "No Access" for
databases they could not connect to.

Fix this by making \l+ also check
pg_has_role('pg_read_all_stats', 'USAGE'), matching
pg_database_size()'s permission rules.

For back branches, emit the pg_read_all_stats check only when
connected to PostgreSQL 10 or later, since earlier releases do not have
that predefined role.

Backpatch to all supported versions.

Author: Christoph Berg <myon@debian.org>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/amCo6qRmnfPVk4-V@msg.df7cb.de
Backpatch-through: 14

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f2d6cf880240b1dcbb8791c2687b017bff23b156

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 5 +++--
src/bin/psql/describe.c        | 4 ++++
2 files changed, 7 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: psql: Allow pg_read_all_stats to see database size in \l+
@ 2026-07-25 10:13 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Fujii Masao @ 2026-07-25 10:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Allow pg_read_all_stats to see database size in \l+

pg_database_size() allows access to users who have either CONNECT
privilege on the target database or privileges of the pg_read_all_stats
role. However, previously, psql's \l+ checked only for CONNECT,
so users with privileges of pg_read_all_stats still saw "No Access" for
databases they could not connect to.

Fix this by making \l+ also check
pg_has_role('pg_read_all_stats', 'USAGE'), matching
pg_database_size()'s permission rules.

For back branches, emit the pg_read_all_stats check only when
connected to PostgreSQL 10 or later, since earlier releases do not have
that predefined role.

Backpatch to all supported versions.

Author: Christoph Berg <myon@debian.org>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/amCo6qRmnfPVk4-V@msg.df7cb.de
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/41949c6f32789301d37f065c403ce694ec3ba959

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 5 +++--
src/bin/psql/describe.c        | 4 ++++
2 files changed, 7 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: psql: Allow pg_read_all_stats to see database size in \l+
@ 2026-07-25 10:13 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Fujii Masao @ 2026-07-25 10:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Allow pg_read_all_stats to see database size in \l+

pg_database_size() allows access to users who have either CONNECT
privilege on the target database or privileges of the pg_read_all_stats
role. However, previously, psql's \l+ checked only for CONNECT,
so users with privileges of pg_read_all_stats still saw "No Access" for
databases they could not connect to.

Fix this by making \l+ also check
pg_has_role('pg_read_all_stats', 'USAGE'), matching
pg_database_size()'s permission rules.

For back branches, emit the pg_read_all_stats check only when
connected to PostgreSQL 10 or later, since earlier releases do not have
that predefined role.

Backpatch to all supported versions.

Author: Christoph Berg <myon@debian.org>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/amCo6qRmnfPVk4-V@msg.df7cb.de
Backpatch-through: 14

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/844bc718ac39c05c6b84ac72e95c5f2d80ad9f28

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 5 +++--
src/bin/psql/describe.c        | 4 ++++
2 files changed, 7 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: psql: Allow pg_read_all_stats to see database size in \l+
@ 2026-07-25 10:14 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Fujii Masao @ 2026-07-25 10:14 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Allow pg_read_all_stats to see database size in \l+

pg_database_size() allows access to users who have either CONNECT
privilege on the target database or privileges of the pg_read_all_stats
role. However, previously, psql's \l+ checked only for CONNECT,
so users with privileges of pg_read_all_stats still saw "No Access" for
databases they could not connect to.

Fix this by making \l+ also check
pg_has_role('pg_read_all_stats', 'USAGE'), matching
pg_database_size()'s permission rules.

For back branches, emit the pg_read_all_stats check only when
connected to PostgreSQL 10 or later, since earlier releases do not have
that predefined role.

Backpatch to all supported versions.

Author: Christoph Berg <myon@debian.org>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/amCo6qRmnfPVk4-V@msg.df7cb.de
Backpatch-through: 14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e6e8a3078b094f209f6e40822c1655ebd34429f5

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 5 +++--
src/bin/psql/describe.c        | 4 ++++
2 files changed, 7 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: psql: Allow pg_read_all_stats to see database size in \l+
@ 2026-07-25 10:14 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Fujii Masao @ 2026-07-25 10:14 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Allow pg_read_all_stats to see database size in \l+

pg_database_size() allows access to users who have either CONNECT
privilege on the target database or privileges of the pg_read_all_stats
role. However, previously, psql's \l+ checked only for CONNECT,
so users with privileges of pg_read_all_stats still saw "No Access" for
databases they could not connect to.

Fix this by making \l+ also check
pg_has_role('pg_read_all_stats', 'USAGE'), matching
pg_database_size()'s permission rules.

For back branches, emit the pg_read_all_stats check only when
connected to PostgreSQL 10 or later, since earlier releases do not have
that predefined role.

Backpatch to all supported versions.

Author: Christoph Berg <myon@debian.org>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/amCo6qRmnfPVk4-V@msg.df7cb.de
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4e19081da88677a6f2e9b6d100768f4f715f95d6

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 5 +++--
src/bin/psql/describe.c        | 4 ++++
2 files changed, 7 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2026-07-25 10:14 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-07-25 10:12 pgsql: psql: Allow pg_read_all_stats to see database size in \l+ Fujii Masao <fujii@postgresql.org>
2026-07-25 10:12 pgsql: psql: Allow pg_read_all_stats to see database size in \l+ Fujii Masao <fujii@postgresql.org>
2026-07-25 10:13 pgsql: psql: Allow pg_read_all_stats to see database size in \l+ Fujii Masao <fujii@postgresql.org>
2026-07-25 10:13 pgsql: psql: Allow pg_read_all_stats to see database size in \l+ Fujii Masao <fujii@postgresql.org>
2026-07-25 10:13 pgsql: psql: Allow pg_read_all_stats to see database size in \l+ Fujii Masao <fujii@postgresql.org>
2026-07-25 10:14 pgsql: psql: Allow pg_read_all_stats to see database size in \l+ Fujii Masao <fujii@postgresql.org>
2026-07-25 10:14 pgsql: psql: Allow pg_read_all_stats to see database size in \l+ Fujii Masao <fujii@postgresql.org>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox