Re: pg_get_databasebyid(oid)

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: pg_get_databasebyid(oid)
Дата
Msg-id 20190904035455.GB2170@paquier.xyz
обсуждение исходный текст
Ответ на Re: pg_get_databasebyid(oid)  (Ibrar Ahmed <ibrar.ahmad@gmail.com>)
Ответы Re: pg_get_databasebyid(oid)  (Sergei Kornilov <sk@zsrv.org>)
Список pgsql-hackers
On Thu, Aug 29, 2019 at 03:47:40PM +0500, Ibrar Ahmed wrote:
> I think its a user request and don't require to be in the core of
> PostgreSQL.
> A simple SQL function can fulfill the requirement of the user.
>
> CREATE OR REPLACE FUNCTION pg_get_databasebyid(dboid integer) RETURNS name
> AS $$
>
>     SELECT datname from pg_database WHERE oid = dboid;
> $$ LANGUAGE SQL;

Indeed, I think that we can drop the patch.  FWIW, I find the
semantics of pg_get_userbyid() horrible when it comes to return a
result for a non-existing user with its own way of defining how this
information should show up.  Returning NULL would be more natural, so
I don't think that we should make more functions behave the same way.
--
Michael

Вложения

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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: [HACKERS] Transactions involving multiple postgres foreignservers, take 2
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Proposal: roll pg_stat_statements into core