docs: pg_replication_origin_oid() description does not match behaviour
Ian Lawrence Barwick <barwick@gmail.com>
From: Ian Lawrence Barwick <barwick@gmail.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-01-18T01:19:41Z
Lists: pgsql-hackers
Attachments
- doc-pg_replication_origin_oid.patch (text/x-patch) patch
Hi
From the documentation for pg_replication_origin_oid() [1]:
> Looks up a replication origin by name and returns the internal ID.
> If no such replication origin is found an error is thrown.
However, it actually returns NULL if the origin does not exist:
postgres=# SELECT * FROM pg_replication_origin;
roident | roname
---------+--------
(0 rows)
postgres=# SELECT pg_replication_origin_oid('foo'),
pg_replication_origin_oid('foo') IS NULL;
pg_replication_origin_oid | ?column?
---------------------------+----------
| t
(1 row)
Given that the code has remained unchanged since the function was
introduced in 9.5, it seems reasonable to change the documentation
to match the function behaviour rather than the other way round.
Regards
Ian Barwick
[1] https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-REPLICATION-TABLE
--
EnterpriseDB: https://www.enterprisedb.com
Commits
-
doc: Fix description of pg_replication_origin_oid() in error case
- cb91cb8aacce 10.20 landed
- d696e63963d2 11.15 landed
- fdb11ad458a7 12.10 landed
- 3204b8a7affc 13.6 landed
- 0f1367c9f381 14.2 landed
- 44129c04323e 15.0 landed