docs: pg_replication_origin_oid() description does not match behaviour

Поиск
Список
Период
Сортировка
От Ian Lawrence Barwick
Тема docs: pg_replication_origin_oid() description does not match behaviour
Дата
Msg-id CAB8KJ=htJjBL=103URqjOxV2mqb4rjphDpMeKdyKq_QXt6h05w@mail.gmail.com
обсуждение исходный текст
Ответы Re: docs: pg_replication_origin_oid() description does not match behaviour  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: drop tablespace failed when location contains .. on win32
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: docs: pg_replication_origin_oid() description does not match behaviour