postgresql/src/backend/catalog
Tom Lane 2cb1272445 Rethink method for assigning OIDs to the template0 and postgres DBs.
Commit aa0105141 assigned fixed OIDs to template0 and postgres
in a very ad-hoc way.  Notably, instead of teaching Catalog.pm
about these OIDs, the unused_oids script was just hacked to
not show them as unused.  That's problematic since, for example,
duplicate_oids wouldn't report any future conflict.  Hence,
invent a macro DECLARE_OID_DEFINING_MACRO() that can be used to
define an OID that is known to Catalog.pm and will participate
in duplicate-detection as well as renumbering by renumber_oids.pl.
(We don't anticipate renumbering these particular OIDs, but we
might as well build out all the Catalog.pm infrastructure while
we're here.)

Another issue is that aa0105141 neglected to touch IsPinnedObject,
with the result that it now claimed template0 and postgres are
pinned.  The right thing to do there seems to be to teach it that
no database is pinned, since in fact DROP DATABASE doesn't check
for pinned-ness (and at least for these cases, that is an
intentional choice).  It's not clear whether this wrong answer
had any visible effect, but perhaps it could have resulted in
erroneous management of dependency entries.

In passing, rename the TemplateDbOid macro to Template1DbOid
to reduce confusion (likely we should have done that way back
when we invented template0, but we didn't), and rename the
OID macros for template0 and postgres to have a similar style.

There are no changes to postgres.bki here, so no need for a
catversion bump.

Discussion: https://postgr.es/m/2935358.1650479692@sss.pgh.pa.us
2022-04-21 16:23:15 -04:00
..
.gitignore Build in some knowledge about foreign-key relationships in the catalogs. 2021-02-02 17:11:55 -05:00
aclchk.c Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
catalog.c Rethink method for assigning OIDs to the template0 and postgres DBs. 2022-04-21 16:23:15 -04:00
Catalog.pm Rethink method for assigning OIDs to the template0 and postgres DBs. 2022-04-21 16:23:15 -04:00
dependency.c Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
genbki.pl Rethink method for assigning OIDs to the template0 and postgres DBs. 2022-04-21 16:23:15 -04:00
heap.c pgstat: scaffolding for transactional stats creation / drop. 2022-04-06 18:27:52 -07:00
index.c pgstat: add pgstat_copy_relation_stats(). 2022-04-06 14:09:18 -07:00
indexing.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
information_schema.sql Fix bogus dependency handling for GENERATED expressions. 2022-03-21 14:58:49 -04:00
Makefile Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
namespace.c Fix temporary object cleanup failing due to toast access without snapshot. 2022-02-21 08:57:34 -08:00
objectaccess.c Add String object access hooks 2022-03-22 10:28:31 -04:00
objectaddress.c Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
partition.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_aggregate.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_attrdef.c Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
pg_cast.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_class.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_collation.c Add option to use ICU as global locale provider 2022-03-17 11:13:16 +01:00
pg_constraint.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_conversion.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_db_role_setting.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_depend.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_enum.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_inherits.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_largeobject.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_namespace.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_operator.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_parameter_acl.c Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
pg_proc.c pgstat: scaffolding for transactional stats creation / drop. 2022-04-06 18:27:52 -07:00
pg_publication.c Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
pg_range.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_shdepend.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_subscription.c Reorder subskiplsn in pg_subscription to avoid alignment issues. 2022-04-07 09:39:25 +05:30
pg_type.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
sql_feature_packages.txt Cleanup in SQL features files 2020-03-28 08:46:18 +01:00
sql_features.txt Add support for MERGE SQL command 2022-03-28 16:47:48 +02:00
storage.c Rename delayChkpt to delayChkptFlags. 2022-04-08 11:44:17 -04:00
system_functions.sql pgstat: add pg_stat_have_stats() test helper. 2022-04-07 00:21:54 -07:00
system_views.sql Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
toasting.c Add UNIQUE null treatment option 2022-02-03 11:48:21 +01:00