On 05/09/21 18:40, Tom Lane wrote: > template1 does have OID 1 in a fresh-from-initdb cluster, but it's > just a database; you can drop it and recreate it if you choose. > I believe that pg_upgrade does so.
I guess it wouldn't even have made me curious, if I hadn't noticed the TemplateDbOid symbol being defined for it, which could end up being wrong after a pg_upgrade. I suppose if it is only ever referred to during bootstrap, no harm's done. Ironically, it might be the most prominently advertised oid_symbol there is, as that entry in pg_database.dat is what's used as the example of .dat-file format in bki.sgml. Regards, -Chap