Re: pg_upgrade allows itself to be run twice

2022-12-18 Thread Michael Paquier
On Fri, Dec 16, 2022 at 07:38:09AM -0600, Justin Pryzby wrote: > However, setting FirstNormalOid in initdb itself (rather than in the > next invocation of postgres, if it isn't in single-user-mode) was the > mechanism by which to avoid the original problem that pg_upgrade can be > run twice, if the

Re: pg_upgrade allows itself to be run twice

2022-12-16 Thread Justin Pryzby
On Thu, Dec 01, 2022 at 10:30:16AM +0100, Peter Eisentraut wrote: > On 01.11.22 14:07, Justin Pryzby wrote: > > On Tue, Nov 01, 2022 at 01:54:35PM +0100, Peter Eisentraut wrote: > > > On 07.07.22 08:22, Justin Pryzby wrote: > > > > > This one comes from NextOID in the control data file after a fres

Re: pg_upgrade allows itself to be run twice

2022-12-01 Thread Peter Eisentraut
On 01.11.22 14:07, Justin Pryzby wrote: On Tue, Nov 01, 2022 at 01:54:35PM +0100, Peter Eisentraut wrote: 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

Re: pg_upgrade allows itself to be run twice

2022-11-01 Thread Justin Pryzby
On Tue, Nov 01, 2022 at 01:54:35PM +0100, Peter Eisentraut wrote: > 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

Re: pg_upgrade allows itself to be run twice

2022-11-01 Thread Peter Eisentraut
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 t

Re: pg_upgrade allows itself to be run twice

2022-09-05 Thread Justin Pryzby
rebased and updated Robert thought that it might be reasonable for someone to initdb, and then connect and make some modifications, and then pg_upgrade. https://www.postgresql.org/message-id/CA%2BTgmoYwaXh_wRRa2CqL4XpM4r6YEbq1%2Bec%3D%2B8b7Dr7-T_tT%2BQ%40mail.gmail.com But the DBs are dropped by

Re: pg_upgrade allows itself to be run twice

2022-07-06 Thread Justin Pryzby
On Wed, Jun 29, 2022 at 01:17:33PM +0900, Michael Paquier wrote: > On Sat, Jun 25, 2022 at 11:04:37AM -0500, Justin Pryzby wrote: > > > I'll concede that a cluster which has no tables sounds a lot like a toy, > > but I > > find it disturbing that nothing prevents running the process twice, up to

Re: pg_upgrade allows itself to be run twice

2022-06-28 Thread Michael Paquier
On Sat, Jun 25, 2022 at 11:04:37AM -0500, Justin Pryzby wrote: > I expect pg_upgrade to fail if I run it twice in a row. Yep. > It would be reasonable if it were to fail during the "--check" phase, > maybe by failing like this: > | New cluster database "..." is not empty: found relation "..." So