Re: pg_upgrade allows itself to be run twice - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: pg_upgrade allows itself to be run twice
Date
Msg-id 2bd2552b-f89e-429b-0bb8-443edb283fb4@enterprisedb.com
Whole thread Raw
In response to Re: pg_upgrade allows itself to be run twice  (Justin Pryzby <pryzby@telsasoft.com>)
Responses Re: pg_upgrade allows itself to be run twice
List pgsql-hackers
On 07.07.22 08:22, Justin Pryzby wrote:
>> This one comes from NextOID in the control data file after a fresh
>> initdb, and GetNewObjectId() would enforce that in a postmaster
>> environment to be FirstNormalObjectId when assigning the first user
>> OID.  Would you imply an extra step at the end of initdb to update the
>> control data file of the new cluster to reflect FirstNormalObjectId?
> I added a call to reset xlog, similar to what's in pg_upgrade.
> Unfortunately, I don't see an easy way to silence it.

I think it would be better to update the control file directly instead 
of going through pg_resetwal.  (See 
src/include/common/controldata_utils.h for the required functions.)

However, I don't know whether we need to add special provisions that 
guard against people using postgres --single in complicated ways.  Many 
consider the single-user mode deprecated outside of initdb use.




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: ResourceOwner refactoring
Next
From: 赵其桂
Date:
Subject: BUG #17663:Connect to the database through jdbc, call the stored procedure containing the rollback statement,the database triggers an assertion, and the database is in recovery mode.