Re: pg_upgrade allows itself to be run twice

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_upgrade allows itself to be run twice
Date: 2022-11-01 12:54:35
Message-ID: 2bd2552b-f89e-429b-0bb8-443edb283fb4@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message 赵其桂 2022-11-01 12:57:00 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.
Previous Message Robert Haas 2022-11-01 12:43:09 Re: ResourceOwner refactoring