From 20bdf41a661ad088257028119c6afaa69ee60d8b Mon Sep 17 00:00:00 2001
From: Zhong ShiHao <zhong950419@gmail.com>
Date: Sat, 5 Sep 2026 09:04:08 -0400
Subject: [PATCH] doc: note that pg_database_size and pg_tablespace_size error
 on missing OID

The introduction to the database object size functions states that
passing an OID that does not represent an existing object returns NULL.
That is true for the relation size functions, but pg_database_size() and
pg_tablespace_size() raise an error instead.  Document the exception.
---
 doc/src/sgml/func/func-admin.sgml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/src/sgml/func/func-admin.sgml b/doc/src/sgml/func/func-admin.sgml
index 0eae1c1f616..ee963084d67 100644
--- a/doc/src/sgml/func/func-admin.sgml
+++ b/doc/src/sgml/func/func-admin.sgml
@@ -1536,7 +1536,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 by
+    <function>pg_database_size</function> and
+    <function>pg_tablespace_size</function>, which raise an error.
    </para>
 
    <table id="functions-admin-dbsize">
-- 
2.37.1 (Apple Git-137.1)

