Re: Strange "permission denied" errors on pg_restore

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Strange "permission denied" errors on pg_restore
Дата
Msg-id
2207734.1719672845@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Strange "permission denied" errors on pg_restore Ron Johnson <ronljohnsonjr@gmail.com>
Re: Strange "permission denied" errors on pg_restore Laurenz Albe <laurenz.albe@cybertec.at>
Re: Strange "permission denied" errors on pg_restore Ron Johnson <ronljohnsonjr@gmail.com>
Re: Strange "permission denied" errors on pg_restore Laurenz Albe <laurenz.albe@cybertec.at>
Re: Strange "permission denied" errors on pg_restore Ron Johnson <ronljohnsonjr@gmail.com>
Re: Strange "permission denied" errors on pg_restore Tom Lane <tgl@sss.pgh.pa.us>
Re: Strange "permission denied" errors on pg_restore Ron Johnson <ronljohnsonjr@gmail.com>
Re: Strange "permission denied" errors on pg_restore Scott Ribe <scott_ribe@elevated-dev.com>
Re: Strange "permission denied" errors on pg_restore Ron Johnson <ronljohnsonjr@gmail.com>
Re: Strange "permission denied" errors on pg_restore Wasim Devale <wasimd60@gmail.com>
Re: Strange "permission denied" errors on pg_restore Ron Johnson <ronljohnsonjr@gmail.com>
Ron Johnson  writes:
> On Sat, Jun 29, 2024 at 1:13 AM Laurenz Albe 
> wrote:
>> You should perform the restore as a superuser or as a user that has all
>> the required permissions.  Restoring with a non-superuser can be tricky.

> I do everything database-related as user "postgres".  Only "sudo yum" is
> run from my personal account.

The failing query seems to be a foreign-key enforcement check that
happened to be triggered from COPY.  Those are run as the owner of
the table that is being checked.  So it appears that in

pg_restore: error: COPY failed for table "batch_rp4_y2022m08": ERROR: permission denied for schema tapschema
LINE 1: SELECT 1 FROM ONLY "tapschema"."lockbox" x WHERE "lockbox_id...
                           ^
QUERY:  SELECT 1 FROM ONLY "tapschema"."lockbox" x WHERE "lockbox_id" OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x

the owner of table "lockbox" lacks usage permission on the containing
schema "tapschema".  That's a most bizarre situation and would have
caused the same sort of FK failures in the originating database as
well.  pg_dump can't really promise to restore databases containing
arbitrarily-broken permissions settings.

			regards, tom lane


В списке pgsql-admin по дате отправления
От: Ron Johnson
Дата:
От: Siraj G
Дата:
Сообщение: Sudden spike in WAL
FAQ