Re: pg_restore 12 "permission denied for schema" errors

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: pg_restore 12 "permission denied for schema" errors
Date: 2022-10-22 22:06:43
Message-ID: c53708b6-6f90-e73b-5bfe-6568fbeb30bf@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/22/22 14:45, Ron wrote:
> On 10/22/22 16:29, Adrian Klaver wrote:

>> To pseudo for me.
>>
>> What file exactly is:
>>
>> pg_restore --jobs=X --no-owner $NEWDB
>>
>> restoring?
>>
>> And how was that file created?
>>
>> Knowing this might help get at why the more straight forward method
>> does not work.
>
> This is what I ran to restore the database:
> export PGHOST=${RDSENV}.xxxxxxxxxxxx.us-east-1.rds.amazonaws.com
> cd /migrate/TASK001793786/2022-10-19b
> NEWDB=sides
> pg_restore -v --create --clean --no-owner --jobs=`nproc` -Fd
> --dbname=template1 $NEWDB
> psql $NEWDB -f all_OWNER.sql
> psql $NEWDB -f all_GRANT.sql
>
> The name of the database is "sides", and there's a directorynamed
> "sides" under /migrate/TASK001793786/2022-10-19b.

Aah, I forgot about the -Fd, now it makes more sense.

To get past the --jobs induced error required the addition of --no-owner
and then adding owners and grants after the main restore.

What was the pg_dump command that produced
/migrate/TASK001793786/2022-10-19b/sides ?

>
>>>
>>>>
>>>>> psql $NEWDB -f all_OWNER.sql
>>>>> psql $NEWDB -f all_GRANT.sql
>>>>>
>>>>> This is, of course, why we need to test the backup/restore process.
>>>>>
>>>>
>>>
>>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2022-10-23 04:23:21 Re: pg_restore 12 "permission denied for schema" errors
Previous Message Ron 2022-10-22 21:45:35 Re: pg_restore 12 "permission denied for schema" errors