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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-bugs by date

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