Skip site navigation (1) Skip section navigation (2)

Re: BUG #1249: pg_restore doesnt handle restoring databases not created as a superuser

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "William Schaub" <talon(at)cosmic-cow(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1249: pg_restore doesnt handle restoring databases not created as a superuser
Date: 2004-09-10 19:32:56
Message-ID: 28667.1094844776@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org> writes:
> When restoring databases with pg_restore with the -C
> option it will connect to template1, set authorization to
> the user that created the database and then reconnect
> as the user that created the database to the new database. this is where the 
> trouble starts, from here on 
> it trys to set authorization back to the superuser to
> do grant and revoke. this will cause the restore to fail.

Hmm.  This is still broken in CVS tip, but I think the correct solution
is just to replace "\connect db user" with "\connect db" everywhere.
This will retain the starting real user authentication throughout the
restore process.  We have completely abandoned use of \connect to change
authorization, and this seems just an unintentional hangover from the
old way.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2004-09-10 19:36:17
Subject: Re: BUG #1250: compilation fails in src/backend/storage/lmgr/s_lock.c
Previous:From: PostgreSQL Bugs ListDate: 2004-09-10 19:28:23
Subject: BUG #1250: compilation fails in src/backend/storage/lmgr/s_lock.c

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group