From 3d2e8573e9cb91bd2b545184f4f9b326d237bcd1 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Tue, 15 Sep 2026 13:46:52 +0200 Subject: [PATCH] doc: Database and tablespace size functions throws error Commit b6463ea6ef3e46 added an explicit ereport on missing object to pg_database_size and pg_tablespace_size, but the documentation wasn't updated to match. Author: Zhong ShiHao Reviewed-by: Chao Li Reviewed-by: solai v Discussion: https://postgr.es/m/CAGRkXqQSegqDnkRf344G=80mJMn78o9u=auHnx=u1jf=XpuE0A@mail.gmail.com Backpatch-through: 18 --- doc/src/sgml/func.sgml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index b57f161f53c..d065b8be1e1 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -30043,7 +30043,9 @@ postgres=# SELECT '0/0'::pg_lsn + pd.segment_number * ps.setting::int + :offset or understanding of usage results. bigint results are measured in bytes. If an OID that does not represent an existing object is passed to one of these - functions, NULL is returned. + functions, NULL is returned, except for + pg_database_size and + pg_tablespace_size, which raise an error. @@ -30125,7 +30127,8 @@ postgres=# SELECT '0/0'::pg_lsn + pd.segment_number * ps.setting::int + :offset name or OID. To use this function, you must have CONNECT privilege on the specified database (which is granted by default) or have privileges of - the pg_read_all_stats role. + the pg_read_all_stats role. Throws an error if the + database does not exist. @@ -30258,7 +30261,8 @@ postgres=# SELECT '0/0'::pg_lsn + pd.segment_number * ps.setting::int + :offset specified name or OID. To use this function, you must have CREATE privilege on the specified tablespace or have privileges of the pg_read_all_stats role, - unless it is the default tablespace for the current database. + unless it is the default tablespace for the current database. Throws + an error if the tablespace does not exist.