pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: pg_restore 12 "permission denied for schema" errors
Date: Sat, 22 Oct 2022 23:23:21 -0500
Message-ID: <cb89e943-a8ce-f986-c719-50d0be8d5b72@gmail.com> (raw)
In-Reply-To: <c53708b6-6f90-e73b-5bfe-6568fbeb30bf@aklaver.com>
References: <287717df-88e2-a4a5-2025-260c39662bca@gmail.com>
	<40fd91d2-d981-2f44-4d58-a3f08a9448fb@familie-gard.de>
	<2980993.1666242738@sss.pgh.pa.us>
	<d073e1ec-86f4-19c7-206e-c76ad9792bdc@gmail.com>
	<ef3ae37b-cab0-7929-e695-e9711685766e@aklaver.com>
	<612cf1c4-1f2d-f068-d6cf-54b98bbeb646@gmail.com>
	<727e6a26-4b58-0aea-a701-9671b8935410@aklaver.com>
	<119d108c-0669-a15d-2afe-3c4116130118@gmail.com>
	<b56a5976-54a0-af76-39fc-5f500736ace7@aklaver.com>
	<4da803e6-407c-19ee-53a0-618c6465ab81@gmail.com>
	<b9a7deb5-67aa-4874-d64e-efc0fdf0b31a@aklaver.com>
	<7d3c6371-b963-1c22-42e3-ecbff8e72f28@gmail.com>
	<c53708b6-6f90-e73b-5bfe-6568fbeb30bf@aklaver.com>

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.





view thread (17+ messages)  latest in thread

Message-ID: <cb89e943-a8ce-f986-c719-50d0be8d5b72@gmail.com>
Permalink:  ../cb89e943-a8ce-f986-c719-50d0be8d5b72@gmail.com/
Also on:    postgresql.org/message-id/cb89e943-a8ce-f986-c719-50d0be8d5b72@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: pg_restore 12 "permission denied for schema" errors
  In-Reply-To: <cb89e943-a8ce-f986-c719-50d0be8d5b72@gmail.com>
  References: <287717df-88e2-a4a5-2025-260c39662bca@gmail.com> <40fd91d2-d981-2f44-4d58-a3f08a9448fb@familie-gard.de> <2980993.1666242738@sss.pgh.pa.us> <d073e1ec-86f4-19c7-206e-c76ad9792bdc@gmail.com> <ef3ae37b-cab0-7929-e695-e9711685766e@aklaver.com> <612cf1c4-1f2d-f068-d6cf-54b98bbeb646@gmail.com> <727e6a26-4b58-0aea-a701-9671b8935410@aklaver.com> <119d108c-0669-a15d-2afe-3c4116130118@gmail.com> <b56a5976-54a0-af76-39fc-5f500736ace7@aklaver.com> <4da803e6-407c-19ee-53a0-618c6465ab81@gmail.com> <b9a7deb5-67aa-4874-d64e-efc0fdf0b31a@aklaver.com> <7d3c6371-b963-1c22-42e3-ecbff8e72f28@gmail.com> <c53708b6-6f90-e73b-5bfe-6568fbeb30bf@aklaver.com> <cb89e943-a8ce-f986-c719-50d0be8d5b72@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox