Re: Feature bug dumpall CREATE ROLE postgres

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Feature bug dumpall CREATE ROLE postgres
Дата
Msg-id CAKFQuwag7VP3Xz=U1xUwCLXo_CGiE5ZBBsjBR+MGhLbvMxP+Ww@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Feature bug dumpall CREATE ROLE postgres  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Tue, Feb 27, 2024 at 1:12 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Jim Wilson <jim@wreath.com> writes:
> Including "CREATE ROLE postgres;" in the dumpall will cause the script to
> throw an error.

I believe the reason pg_dumpall does that is to avoid worse failures
if the target installation has a different bootstrap superuser name
than the source did.  One error is easier to ignore than hundreds
of 'em.

Why are we catering to the 0.0001 percent here?

Put this in the dumpall file instead of a create role command:
pseudo-code
DO $$
if 10::oid::regrole != 'postgres' then
raise error 'bootstrap superuser is named postgres in source database'
raise error 'either rename your bootstrap superuser to postgres or create a new superuser named postgres'
end if;
$$;

Or, any chance we can just write:

alter table tbl owner to 10::oid;

and not care what specific label the bootstrap superuser is using?

More simply I suppose is to have an option on pg_dumpall to omit the bootstrap superuser create role command to at least avoid having people have to modify the dump file after the fact.

David J.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Feature bug dumpall CREATE ROLE postgres
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #18369: logical decoding core on AssertTXNLsnOrder()