postgresql/src/include/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
binary_upgrade.h pg_upgrade: Preserve relfilenodes and tablespace OIDs. 2022-01-17 13:40:27 -05:00
catalog.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
catversion.h Teach planner and executor about monotonic window funcs 2022-04-08 10:34:36 +12:00
dependency.h Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
duplicate_oids Update copyright for 2022 2022-01-07 19:04:57 -05:00
genbki.h Rethink method for assigning OIDs to the template0 and postgres DBs. 2022-04-21 16:23:15 -04:00
heap.h Move pg_attrdef manipulation code into new file catalog/pg_attrdef.c. 2022-03-21 14:38:23 -04:00
index.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
indexing.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
Makefile Update copyright for 2022 2022-01-07 19:04:57 -05:00
namespace.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
objectaccess.h Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
objectaddress.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
partition.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_aggregate.dat Add range_agg with multirange inputs 2022-03-30 20:16:23 +02:00
pg_aggregate.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_am.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_am.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_amop.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_amop.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_amproc.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_amproc.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_attrdef.h Move pg_attrdef manipulation code into new file catalog/pg_attrdef.c. 2022-03-21 14:38:23 -04:00
pg_attribute.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_auth_members.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_authid.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_authid.h Use DECLARE_TOAST_WITH_MACRO() to simplify toast-table declarations. 2022-04-21 12:02:23 -04:00
pg_cast.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_cast.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_class.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_class.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_collation.dat Add option to use ICU as global locale provider 2022-03-17 11:13:16 +01:00
pg_collation.h Add option to use ICU as global locale provider 2022-03-17 11:13:16 +01:00
pg_constraint.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_control.h Remove exclusive backup mode 2022-04-06 14:41:03 -04:00
pg_conversion.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_conversion.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_database.dat Rethink method for assigning OIDs to the template0 and postgres DBs. 2022-04-21 16:23:15 -04:00
pg_database.h Rethink method for assigning OIDs to the template0 and postgres DBs. 2022-04-21 16:23:15 -04:00
pg_db_role_setting.h Use DECLARE_TOAST_WITH_MACRO() to simplify toast-table declarations. 2022-04-21 12:02:23 -04:00
pg_default_acl.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_depend.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_description.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_enum.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_event_trigger.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_extension.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_foreign_data_wrapper.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_foreign_server.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_foreign_table.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_index.h Add UNIQUE null treatment option 2022-02-03 11:48:21 +01:00
pg_inherits.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_init_privs.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_language.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_language.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_largeobject.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_largeobject_metadata.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_namespace.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_namespace.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_opclass.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_opclass.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_operator.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_operator.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_opfamily.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_opfamily.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_parameter_acl.h Use DECLARE_TOAST_WITH_MACRO() to simplify toast-table declarations. 2022-04-21 12:02:23 -04:00
pg_partitioned_table.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_policy.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_proc.dat Teach planner and executor about monotonic window funcs 2022-04-08 10:34:36 +12:00
pg_proc.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_publication.h Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
pg_publication_namespace.h Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
pg_publication_rel.h Allow specifying column lists for logical replication 2022-03-26 01:01:27 +01:00
pg_range.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_range.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_replication_origin.h Use DECLARE_TOAST_WITH_MACRO() to simplify toast-table declarations. 2022-04-21 12:02:23 -04:00
pg_rewrite.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_seclabel.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_sequence.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_shdepend.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_shdescription.h Use DECLARE_TOAST_WITH_MACRO() to simplify toast-table declarations. 2022-04-21 12:02:23 -04:00
pg_shseclabel.h Use DECLARE_TOAST_WITH_MACRO() to simplify toast-table declarations. 2022-04-21 12:02:23 -04:00
pg_statistic.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_statistic_ext.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_statistic_ext_data.h Add stxdinherit flag to pg_statistic_ext_data 2022-01-16 13:38:01 +01:00
pg_subscription.h Use DECLARE_TOAST_WITH_MACRO() to simplify toast-table declarations. 2022-04-21 12:02:23 -04:00
pg_subscription_rel.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_tablespace.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_tablespace.h Use DECLARE_TOAST_WITH_MACRO() to simplify toast-table declarations. 2022-04-21 12:02:23 -04:00
pg_transform.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_trigger.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_ts_config.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_ts_config.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_ts_config_map.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_ts_config_map.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_ts_dict.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_ts_dict.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_ts_parser.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_ts_parser.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_ts_template.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_ts_template.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_type.dat Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_type.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_user_mapping.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
reformat_dat_file.pl Update copyright for 2022 2022-01-07 19:04:57 -05:00
renumber_oids.pl Rethink method for assigning OIDs to the template0 and postgres DBs. 2022-04-21 16:23:15 -04:00
storage.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
storage_xlog.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
toasting.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
unused_oids Rethink method for assigning OIDs to the template0 and postgres DBs. 2022-04-21 16:23:15 -04:00