postgres.git / summary / log / commit / refs

commit    3d2e8573e9cb91bd2b545184f4f9b326d237bcd1
Author:   Daniel Gustafsson <dgustafsson@postgresql.org>
Date:     Tue Sep 15 11:46:52 2026 +0000
First released in: 18.7, 19.0

    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 <zhong950419@gmail.com>
    Reviewed-by: Chao Li <li.evan.chao@gmail.com>
    Reviewed-by: solai v <solai.cdac@gmail.com>
    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. <literal>bigint</literal> results are measured in bytes. If an OID that does not represent an existing object is passed to one of these - functions, <literal>NULL</literal> is returned. + functions, <literal>NULL</literal> is returned, except for + <function>pg_database_size</function> and + <function>pg_tablespace_size</function>, which raise an error. </para> <table id="functions-admin-dbsize"> @@ -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 <literal>CONNECT</literal> privilege on the specified database (which is granted by default) or have privileges of - the <literal>pg_read_all_stats</literal> role. + the <literal>pg_read_all_stats</literal> role. Throws an error if the + database does not exist. </para></entry> </row> @@ -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 <literal>CREATE</literal> privilege on the specified tablespace or have privileges of the <literal>pg_read_all_stats</literal> 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. </para></entry> </row> [parent: 6567f3f1f213]