Re: Problem with pg_upgrade (8.4 -> 9.0) due to ALTER DATABASE SET ROLE - Mailing list pgsql-hackers

From Florian Pflug
Subject Re: Problem with pg_upgrade (8.4 -> 9.0) due to ALTER DATABASE SET ROLE
Date
Msg-id 2628800C-D53C-4885-A089-C771A83E84BD@phlo.org
Whole thread Raw
In response to Re: Problem with pg_upgrade (8.4 -> 9.0) due to ALTER DATABASE SET ROLE  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Problem with pg_upgrade (8.4 -> 9.0) due to ALTER DATABASE SET ROLE
List pgsql-hackers
On Dec13, 2010, at 00:16 , Robert Haas wrote:
> And in fact it strikes me that we might not have much choice about how
> to fix this.  I think we are not going to retroactively change the
> behavior of ALTER DATABASE .. SET ROLE in a released version, but yet
> we do, I think, want to make pg_upgrade work.


A simple fix is to teach pg_upgrade to issue "RESET SESSION AUTHORIZATION" immediately after connecting to a database.
Idon't see any downside of this currently - it seems that the only case where this wouldn't be a NO-OP is if someone
setROLE to to something else either per-database, per-user or both. 

Actually, I'd like to provide an option for pg_dump and pg_restore to do that too (not by default, though). If people
thinkthis is a good idea, I could come up with a patch. 

best regards,
Florian Pflug



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED
Next
From: Rob Wultsch
Date:
Subject: Re: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED