Re: pg_restore 12 "permission denied for schema" errors - Mailing list pgsql-general

From Ron
Subject Re: pg_restore 12 "permission denied for schema" errors
Date
Msg-id cb89e943-a8ce-f986-c719-50d0be8d5b72@gmail.com
Whole thread Raw
In response to Re: pg_restore 12 "permission denied for schema" errors  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
On 10/22/22 17:06, Adrian Klaver wrote:
> 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 ?

PGHOST=mumble.xxxxxxxxxxxx.us-east-1.rds.amazonaws.com
PGUSER=postgres
cd /migrate/TASK001793786/`date +%F`
DB=sides
pg_dump -d $DB -j4 -Z0 -v -Fd --file=$DB 2> ${DB}_pgdump.log

-- 
Angular momentum makes the world go 'round.



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: pg_restore 12 "permission denied for schema" errors
Next
From: Tom Lane
Date:
Subject: Re: pg_restore 12 "permission denied for schema" errors