Re: pg_dumpall with flag --no-role-passwords omits roles comments as well

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: pg_dumpall with flag --no-role-passwords omits roles comments as well
Дата
Msg-id 86FC9F16-E6AA-4C04-B0FB-024662CA8D2A@yesql.se
обсуждение исходный текст
Ответ на pg_dumpall with flag --no-role-passwords omits roles comments as well  (Bartosz Chroł <bartosz.chrol@handen.pl>)
Ответы Re: pg_dumpall with flag --no-role-passwords omits roles comments as well
Re: pg_dumpall with flag --no-role-passwords omits roles comments as well
Список pgsql-general
> On 20 Mar 2024, at 18:40, Bartosz Chroł <bartosz.chrol@handen.pl> wrote:
>
> Hello,
> I've tried to dump roles using the following call to pg_dumpall:
> pg_dumpall.exe --roles-only --no-role-passwords
> However I noticed that comments on roles are also omitted from the dump, as if --no--comments flag was set - but it
wasn't.
> When I call `pg_dumpall.exe --roles-only` than it works as expected - both passwords and comments are dumped.
>
> Is it correct behaviour? It doesn't look like to me, but maybe I'm missing something. I've checked PostgreSQL 16.2
(onWindows 11 and Ubuntu 20) and 14.0 (on Windows Server 2019), same everywhere. 

Comments on roles are stored against the pg_authid catalog relation which is
the catalog used for dumping roles, but when using --no-role-passwords we
instead switch to using the pg_roles catalog relation.  Since comments are
dumped for the relations which are dumped, this means that the comments on
roles are omitted when --no-role-passwords is used.

It's not clear whether that was intentional or not, I'm failing to find the
thread where it was discussed on a quick mailing list search.  It kind of feels
like an accidental bug since the restored role will be in pg_authid where the
comment should be attached.

--
Daniel Gustafsson




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

Предыдущее
От: Joseph Kennedy
Дата:
Сообщение: Question about PostgreSQL upgrade from version 12 to version 15
Следующее
От: Dominique Devienne
Дата:
Сообщение: Re: pg_dumpall with flag --no-role-passwords omits roles comments as well