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.