Generate syscache info from catalog files
authorPeter Eisentraut <peter@eisentraut.org>
Tue, 23 Jan 2024 06:13:38 +0000 (07:13 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Tue, 23 Jan 2024 06:31:06 +0000 (07:31 +0100)
Add a new genbki macros MAKE_SYSCACHE that specifies the syscache ID
macro, the underlying index, and the number of buckets.  From that, we
can generate the existing tables in syscache.h and syscache.c via
genbki.pl.

Reviewed-by: John Naylor <johncnaylorls@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/75ae5875-3abc-dafc-8aec-73247ed41cde@eisentraut.org

60 files changed:
src/backend/catalog/.gitignore
src/backend/catalog/Catalog.pm
src/backend/catalog/Makefile
src/backend/catalog/genbki.pl
src/backend/utils/cache/syscache.c
src/include/catalog/.gitignore
src/include/catalog/genbki.h
src/include/catalog/meson.build
src/include/catalog/pg_aggregate.h
src/include/catalog/pg_am.h
src/include/catalog/pg_amop.h
src/include/catalog/pg_amproc.h
src/include/catalog/pg_attribute.h
src/include/catalog/pg_auth_members.h
src/include/catalog/pg_authid.h
src/include/catalog/pg_cast.h
src/include/catalog/pg_class.h
src/include/catalog/pg_collation.h
src/include/catalog/pg_constraint.h
src/include/catalog/pg_conversion.h
src/include/catalog/pg_database.h
src/include/catalog/pg_default_acl.h
src/include/catalog/pg_enum.h
src/include/catalog/pg_event_trigger.h
src/include/catalog/pg_foreign_data_wrapper.h
src/include/catalog/pg_foreign_server.h
src/include/catalog/pg_foreign_table.h
src/include/catalog/pg_index.h
src/include/catalog/pg_language.h
src/include/catalog/pg_namespace.h
src/include/catalog/pg_opclass.h
src/include/catalog/pg_operator.h
src/include/catalog/pg_opfamily.h
src/include/catalog/pg_parameter_acl.h
src/include/catalog/pg_partitioned_table.h
src/include/catalog/pg_proc.h
src/include/catalog/pg_publication.h
src/include/catalog/pg_publication_namespace.h
src/include/catalog/pg_publication_rel.h
src/include/catalog/pg_range.h
src/include/catalog/pg_replication_origin.h
src/include/catalog/pg_rewrite.h
src/include/catalog/pg_sequence.h
src/include/catalog/pg_statistic.h
src/include/catalog/pg_statistic_ext.h
src/include/catalog/pg_statistic_ext_data.h
src/include/catalog/pg_subscription.h
src/include/catalog/pg_subscription_rel.h
src/include/catalog/pg_tablespace.h
src/include/catalog/pg_transform.h
src/include/catalog/pg_ts_config.h
src/include/catalog/pg_ts_config_map.h
src/include/catalog/pg_ts_dict.h
src/include/catalog/pg_ts_parser.h
src/include/catalog/pg_ts_template.h
src/include/catalog/pg_type.h
src/include/catalog/pg_user_mapping.h
src/include/utils/syscache.h
src/tools/pginclude/cpluspluscheck
src/tools/pginclude/headerscheck

index 237ff541659b15a680c160be93f9cbdb72fd61ac..b580f734c71799ada57ab2dee94247c1477c0e05 100644 (file)
@@ -1,5 +1,7 @@
 /postgres.bki
 /schemapg.h
+/syscache_ids.h
+/syscache_info.h
 /system_fk_info.h
 /system_constraints.sql
 /pg_*_d.h
index 643560cd473dd32d56fdcc2e0235262858d74e5e..55a8877aede58a302c87065b8e319a47fa1458a6 100644 (file)
@@ -129,6 +129,16 @@ sub ParseHeader
                                %+,
                          };
                }
+               elsif (
+                       /^MAKE_SYSCACHE\(\s*
+                       (?<syscache_name>\w+),\s*
+                       (?<index_name>\w+),\s*
+                       (?<syscache_nbuckets>\w+)\s*
+                       \)/x
+                 )
+               {
+                       push @{ $catalog{syscaches} }, {%+};
+               }
                elsif (
                        /^DECLARE_OID_DEFINING_MACRO\(\s*
                         (?<other_name>\w+),\s*
index d6b23b4bfd5dfb61e3530b38c494fd6d76557ec6..352ba6d3e2eb85a7a5c710ed5322e6ab8ea5c7c1 100644 (file)
@@ -120,7 +120,7 @@ CATALOG_HEADERS := \
        pg_subscription.h \
        pg_subscription_rel.h
 
-GENERATED_HEADERS := $(CATALOG_HEADERS:%.h=%_d.h) schemapg.h system_fk_info.h
+GENERATED_HEADERS := $(CATALOG_HEADERS:%.h=%_d.h) schemapg.h syscache_ids.h syscache_info.h system_fk_info.h
 
 POSTGRES_BKI_SRCS := $(addprefix $(top_srcdir)/src/include/catalog/, $(CATALOG_HEADERS))
 
index 93553e8c3c4c28557f257eb8bd7802f6387ade95..94afdc5491dd8cb38b4de14f074d81ddf437ab44 100644 (file)
@@ -56,6 +56,8 @@ my %catalogs;
 my %catalog_data;
 my @toast_decls;
 my @index_decls;
+my %syscaches;
+my %syscache_catalogs;
 my %oidcounts;
 my @system_constraints;
 
@@ -121,6 +123,9 @@ foreach my $header (@ARGV)
                }
        }
 
+       # Lookup table to get index info by index name
+       my %indexes;
+
        # If the header file contained toast or index info, build BKI
        # commands for those, which we'll output later.
        foreach my $toast (@{ $catalog->{toasting} })
@@ -134,6 +139,8 @@ foreach my $header (@ARGV)
        }
        foreach my $index (@{ $catalog->{indexing} })
        {
+               $indexes{ $index->{index_name} } = $index;
+
                push @index_decls,
                  sprintf "declare %sindex %s %s on %s using %s\n",
                  $index->{is_unique} ? 'unique ' : '',
@@ -151,6 +158,26 @@ foreach my $header (@ARGV)
                          $index->{index_name};
                }
        }
+
+       # Analyze syscache info
+       foreach my $syscache (@{ $catalog->{syscaches} })
+       {
+               my $index = $indexes{ $syscache->{index_name} };
+               my $tblname = $index->{table_name};
+               my $key = $index->{index_decl};
+               $key =~ s/^\w+\(//;
+               $key =~ s/\)$//;
+               $key =~ s/(\w+)\s+\w+/Anum_${tblname}_$1/g;
+
+               $syscaches{ $syscache->{syscache_name} } = {
+                       table_oid_macro => $catalogs{$tblname}->{relation_oid_macro},
+                       index_oid_macro => $index->{index_oid_macro},
+                       key => $key,
+                       nbuckets => $syscache->{syscache_nbuckets},
+               };
+
+               $syscache_catalogs{$catname} = 1;
+       }
 }
 
 # Complain and exit if we found any duplicate OIDs.
@@ -419,6 +446,12 @@ open my $fk_info, '>', $fk_info_file . $tmpext
 my $constraints_file = $output_path . 'system_constraints.sql';
 open my $constraints, '>', $constraints_file . $tmpext
   or die "can't open $constraints_file$tmpext: $!";
+my $syscache_ids_file = $output_path . 'syscache_ids.h';
+open my $syscache_ids_fh, '>', $syscache_ids_file . $tmpext
+  or die "can't open $syscache_ids_file$tmpext: $!";
+my $syscache_info_file = $output_path . 'syscache_info.h';
+open my $syscache_info_fh, '>', $syscache_info_file . $tmpext
+  or die "can't open $syscache_info_file$tmpext: $!";
 
 # Generate postgres.bki and pg_*_d.h headers.
 
@@ -753,17 +786,59 @@ foreach my $catname (@catnames)
 # Closing boilerplate for system_fk_info.h
 print $fk_info "};\n\n#endif\t\t\t\t\t\t\t/* SYSTEM_FK_INFO_H */\n";
 
+# Now generate syscache info
+
+print_boilerplate($syscache_ids_fh, "syscache_ids.h", "SysCache identifiers");
+print $syscache_ids_fh "enum SysCacheIdentifier
+{
+";
+
+print_boilerplate($syscache_info_fh, "syscache_info.h",
+       "SysCache definitions");
+print $syscache_info_fh "\n";
+foreach my $catname (sort keys %syscache_catalogs)
+{
+       print $syscache_info_fh qq{#include "catalog/${catname}_d.h"\n};
+}
+print $syscache_info_fh "\n";
+print $syscache_info_fh "static const struct cachedesc cacheinfo[] = {\n";
+
+my $last_syscache;
+foreach my $syscache (sort keys %syscaches)
+{
+       print $syscache_ids_fh "\t$syscache,\n";
+       $last_syscache = $syscache;
+
+       print $syscache_info_fh "\t[$syscache] = {\n";
+       print $syscache_info_fh "\t\t", $syscaches{$syscache}{table_oid_macro},
+         ",\n";
+       print $syscache_info_fh "\t\t", $syscaches{$syscache}{index_oid_macro},
+         ",\n";
+       print $syscache_info_fh "\t\tKEY(", $syscaches{$syscache}{key}, "),\n";
+       print $syscache_info_fh "\t\t", $syscaches{$syscache}{nbuckets}, "\n";
+       print $syscache_info_fh "\t},\n";
+}
+
+print $syscache_ids_fh "};\n";
+print $syscache_ids_fh "#define SysCacheSize ($last_syscache + 1)\n";
+
+print $syscache_info_fh "};\n";
+
 # We're done emitting data
 close $bki;
 close $schemapg;
 close $fk_info;
 close $constraints;
+close $syscache_ids_fh;
+close $syscache_info_fh;
 
 # Finally, rename the completed files into place.
 Catalog::RenameTempFile($bkifile, $tmpext);
 Catalog::RenameTempFile($schemafile, $tmpext);
 Catalog::RenameTempFile($fk_info_file, $tmpext);
 Catalog::RenameTempFile($constraints_file, $tmpext);
+Catalog::RenameTempFile($syscache_ids_file, $tmpext);
+Catalog::RenameTempFile($syscache_info_file, $tmpext);
 
 exit($num_errors != 0 ? 1 : 0);
 
index c10a7b3d0d2258d00e13769a7c386717d251976c..162855b1587b0eb3b142479481ac1b611004d394 100644 (file)
 
 #include "access/htup_details.h"
 #include "access/sysattr.h"
-#include "catalog/pg_aggregate.h"
-#include "catalog/pg_am.h"
-#include "catalog/pg_amop.h"
-#include "catalog/pg_amproc.h"
-#include "catalog/pg_auth_members.h"
-#include "catalog/pg_authid.h"
-#include "catalog/pg_cast.h"
-#include "catalog/pg_collation.h"
-#include "catalog/pg_constraint.h"
-#include "catalog/pg_conversion.h"
-#include "catalog/pg_database.h"
-#include "catalog/pg_db_role_setting.h"
-#include "catalog/pg_default_acl.h"
-#include "catalog/pg_depend.h"
-#include "catalog/pg_description.h"
-#include "catalog/pg_enum.h"
-#include "catalog/pg_event_trigger.h"
-#include "catalog/pg_foreign_data_wrapper.h"
-#include "catalog/pg_foreign_server.h"
-#include "catalog/pg_foreign_table.h"
-#include "catalog/pg_language.h"
-#include "catalog/pg_namespace.h"
-#include "catalog/pg_opclass.h"
-#include "catalog/pg_operator.h"
-#include "catalog/pg_opfamily.h"
-#include "catalog/pg_parameter_acl.h"
-#include "catalog/pg_partitioned_table.h"
-#include "catalog/pg_proc.h"
-#include "catalog/pg_publication.h"
-#include "catalog/pg_publication_namespace.h"
-#include "catalog/pg_publication_rel.h"
-#include "catalog/pg_range.h"
-#include "catalog/pg_replication_origin.h"
-#include "catalog/pg_rewrite.h"
-#include "catalog/pg_seclabel.h"
-#include "catalog/pg_sequence.h"
-#include "catalog/pg_shdepend.h"
-#include "catalog/pg_shdescription.h"
-#include "catalog/pg_shseclabel.h"
-#include "catalog/pg_statistic.h"
-#include "catalog/pg_statistic_ext.h"
-#include "catalog/pg_statistic_ext_data.h"
-#include "catalog/pg_subscription.h"
-#include "catalog/pg_subscription_rel.h"
-#include "catalog/pg_tablespace.h"
-#include "catalog/pg_transform.h"
-#include "catalog/pg_ts_config.h"
-#include "catalog/pg_ts_config_map.h"
-#include "catalog/pg_ts_dict.h"
-#include "catalog/pg_ts_parser.h"
-#include "catalog/pg_ts_template.h"
-#include "catalog/pg_type.h"
-#include "catalog/pg_user_mapping.h"
+#include "catalog/pg_db_role_setting_d.h"
+#include "catalog/pg_depend_d.h"
+#include "catalog/pg_description_d.h"
+#include "catalog/pg_seclabel_d.h"
+#include "catalog/pg_shdepend_d.h"
+#include "catalog/pg_shdescription_d.h"
+#include "catalog/pg_shseclabel_d.h"
 #include "lib/qunique.h"
 #include "utils/catcache.h"
 #include "utils/lsyscache.h"
 
        Adding system caches:
 
-       Add your new cache to the list in include/utils/syscache.h.
-       Keep the list sorted alphabetically.
-
-       Add your entry to the cacheinfo[] array below. All cache lists are
-       alphabetical, so add it in the proper place.  Specify the relation OID,
-       index OID, number of keys, key attribute numbers, and initial number of
-       hash buckets.
-
-       The number of hash buckets must be a power of 2.  It's reasonable to
-       set this to the number of entries that might be in the particular cache
-       in a medium-size database.
-
        There must be a unique index underlying each syscache (ie, an index
        whose key is the same as that of the cache).  If there is not one
        already, add the definition for it to include/catalog/pg_*.h using
        (Adding an index requires a catversion.h update, while simply
        adding/deleting caches only requires a recompile.)
 
+       Add a MAKE_SYSCACHE call to the same pg_*.h file specifying the name of
+       your cache, the underlying index, and the initial number of hash buckets.
+
+       The number of hash buckets must be a power of 2.  It's reasonable to
+       set this to the number of entries that might be in the particular cache
+       in a medium-size database.
+
        Finally, any place your relation gets heap_insert() or
        heap_update() calls, use CatalogTupleInsert() or CatalogTupleUpdate()
        instead, which also update indexes.  The heap_* calls do not do that.
@@ -126,558 +75,7 @@ struct cachedesc
 /* Macro to provide nkeys and key array with convenient syntax. */
 #define KEY(...) VA_ARGS_NARGS(__VA_ARGS__), { __VA_ARGS__ }
 
-static const struct cachedesc cacheinfo[] = {
-       [AGGFNOID] = {
-               AggregateRelationId,
-               AggregateFnoidIndexId,
-               KEY(Anum_pg_aggregate_aggfnoid),
-               16
-       },
-       [AMNAME] = {
-               AccessMethodRelationId,
-               AmNameIndexId,
-               KEY(Anum_pg_am_amname),
-               4
-       },
-       [AMOID] = {
-               AccessMethodRelationId,
-               AmOidIndexId,
-               KEY(Anum_pg_am_oid),
-               4
-       },
-       [AMOPOPID] = {
-               AccessMethodOperatorRelationId,
-               AccessMethodOperatorIndexId,
-               KEY(Anum_pg_amop_amopopr,
-                       Anum_pg_amop_amoppurpose,
-                       Anum_pg_amop_amopfamily),
-               64
-       },
-       [AMOPSTRATEGY] = {
-               AccessMethodOperatorRelationId,
-               AccessMethodStrategyIndexId,
-               KEY(Anum_pg_amop_amopfamily,
-                       Anum_pg_amop_amoplefttype,
-                       Anum_pg_amop_amoprighttype,
-                       Anum_pg_amop_amopstrategy),
-               64
-       },
-       [AMPROCNUM] = {
-               AccessMethodProcedureRelationId,
-               AccessMethodProcedureIndexId,
-               KEY(Anum_pg_amproc_amprocfamily,
-                       Anum_pg_amproc_amproclefttype,
-                       Anum_pg_amproc_amprocrighttype,
-                       Anum_pg_amproc_amprocnum),
-               16
-       },
-       [ATTNAME] = {
-               AttributeRelationId,
-               AttributeRelidNameIndexId,
-               KEY(Anum_pg_attribute_attrelid,
-                       Anum_pg_attribute_attname),
-               32
-       },
-       [ATTNUM] = {
-               AttributeRelationId,
-               AttributeRelidNumIndexId,
-               KEY(Anum_pg_attribute_attrelid,
-                       Anum_pg_attribute_attnum),
-               128
-       },
-       [AUTHMEMMEMROLE] = {
-               AuthMemRelationId,
-               AuthMemMemRoleIndexId,
-               KEY(Anum_pg_auth_members_member,
-                       Anum_pg_auth_members_roleid,
-                       Anum_pg_auth_members_grantor),
-               8
-       },
-       [AUTHMEMROLEMEM] = {
-               AuthMemRelationId,
-               AuthMemRoleMemIndexId,
-               KEY(Anum_pg_auth_members_roleid,
-                       Anum_pg_auth_members_member,
-                       Anum_pg_auth_members_grantor),
-               8
-       },
-       [AUTHNAME] = {
-               AuthIdRelationId,
-               AuthIdRolnameIndexId,
-               KEY(Anum_pg_authid_rolname),
-               8
-       },
-       [AUTHOID] = {
-               AuthIdRelationId,
-               AuthIdOidIndexId,
-               KEY(Anum_pg_authid_oid),
-               8
-       },
-       [CASTSOURCETARGET] = {
-               CastRelationId,
-               CastSourceTargetIndexId,
-               KEY(Anum_pg_cast_castsource,
-                       Anum_pg_cast_casttarget),
-               256
-       },
-       [CLAAMNAMENSP] = {
-               OperatorClassRelationId,
-               OpclassAmNameNspIndexId,
-               KEY(Anum_pg_opclass_opcmethod,
-                       Anum_pg_opclass_opcname,
-                       Anum_pg_opclass_opcnamespace),
-               8
-       },
-       [CLAOID] = {
-               OperatorClassRelationId,
-               OpclassOidIndexId,
-               KEY(Anum_pg_opclass_oid),
-               8
-       },
-       [COLLNAMEENCNSP] = {
-               CollationRelationId,
-               CollationNameEncNspIndexId,
-               KEY(Anum_pg_collation_collname,
-                       Anum_pg_collation_collencoding,
-                       Anum_pg_collation_collnamespace),
-               8
-       },
-       [COLLOID] = {
-               CollationRelationId,
-               CollationOidIndexId,
-               KEY(Anum_pg_collation_oid),
-               8
-       },
-       [CONDEFAULT] = {
-               ConversionRelationId,
-               ConversionDefaultIndexId,
-               KEY(Anum_pg_conversion_connamespace,
-                       Anum_pg_conversion_conforencoding,
-                       Anum_pg_conversion_contoencoding,
-                       Anum_pg_conversion_oid),
-               8
-       },
-       [CONNAMENSP] = {
-               ConversionRelationId,
-               ConversionNameNspIndexId,
-               KEY(Anum_pg_conversion_conname,
-                       Anum_pg_conversion_connamespace),
-               8
-       },
-       [CONSTROID] = {
-               ConstraintRelationId,
-               ConstraintOidIndexId,
-               KEY(Anum_pg_constraint_oid),
-               16
-       },
-       [CONVOID] = {
-               ConversionRelationId,
-               ConversionOidIndexId,
-               KEY(Anum_pg_conversion_oid),
-               8
-       },
-       [DATABASEOID] = {
-               DatabaseRelationId,
-               DatabaseOidIndexId,
-               KEY(Anum_pg_database_oid),
-               4
-       },
-       [DEFACLROLENSPOBJ] = {
-               DefaultAclRelationId,
-               DefaultAclRoleNspObjIndexId,
-               KEY(Anum_pg_default_acl_defaclrole,
-                       Anum_pg_default_acl_defaclnamespace,
-                       Anum_pg_default_acl_defaclobjtype),
-               8
-       },
-       [ENUMOID] = {
-               EnumRelationId,
-               EnumOidIndexId,
-               KEY(Anum_pg_enum_oid),
-               8
-       },
-       [ENUMTYPOIDNAME] = {
-               EnumRelationId,
-               EnumTypIdLabelIndexId,
-               KEY(Anum_pg_enum_enumtypid,
-                       Anum_pg_enum_enumlabel),
-               8
-       },
-       [EVENTTRIGGERNAME] = {
-               EventTriggerRelationId,
-               EventTriggerNameIndexId,
-               KEY(Anum_pg_event_trigger_evtname),
-               8
-       },
-       [EVENTTRIGGEROID] = {
-               EventTriggerRelationId,
-               EventTriggerOidIndexId,
-               KEY(Anum_pg_event_trigger_oid),
-               8
-       },
-       [FOREIGNDATAWRAPPERNAME] = {
-               ForeignDataWrapperRelationId,
-               ForeignDataWrapperNameIndexId,
-               KEY(Anum_pg_foreign_data_wrapper_fdwname),
-               2
-       },
-       [FOREIGNDATAWRAPPEROID] = {
-               ForeignDataWrapperRelationId,
-               ForeignDataWrapperOidIndexId,
-               KEY(Anum_pg_foreign_data_wrapper_oid),
-               2
-       },
-       [FOREIGNSERVERNAME] = {
-               ForeignServerRelationId,
-               ForeignServerNameIndexId,
-               KEY(Anum_pg_foreign_server_srvname),
-               2
-       },
-       [FOREIGNSERVEROID] = {
-               ForeignServerRelationId,
-               ForeignServerOidIndexId,
-               KEY(Anum_pg_foreign_server_oid),
-               2
-       },
-       [FOREIGNTABLEREL] = {
-               ForeignTableRelationId,
-               ForeignTableRelidIndexId,
-               KEY(Anum_pg_foreign_table_ftrelid),
-               4
-       },
-       [INDEXRELID] = {
-               IndexRelationId,
-               IndexRelidIndexId,
-               KEY(Anum_pg_index_indexrelid),
-               64
-       },
-       [LANGNAME] = {
-               LanguageRelationId,
-               LanguageNameIndexId,
-               KEY(Anum_pg_language_lanname),
-               4
-       },
-       [LANGOID] = {
-               LanguageRelationId,
-               LanguageOidIndexId,
-               KEY(Anum_pg_language_oid),
-               4
-       },
-       [NAMESPACENAME] = {
-               NamespaceRelationId,
-               NamespaceNameIndexId,
-               KEY(Anum_pg_namespace_nspname),
-               4
-       },
-       [NAMESPACEOID] = {
-               NamespaceRelationId,
-               NamespaceOidIndexId,
-               KEY(Anum_pg_namespace_oid),
-               16
-       },
-       [OPERNAMENSP] = {
-               OperatorRelationId,
-               OperatorNameNspIndexId,
-               KEY(Anum_pg_operator_oprname,
-                       Anum_pg_operator_oprleft,
-                       Anum_pg_operator_oprright,
-                       Anum_pg_operator_oprnamespace),
-               256
-       },
-       [OPEROID] = {
-               OperatorRelationId,
-               OperatorOidIndexId,
-               KEY(Anum_pg_operator_oid),
-               32
-       },
-       [OPFAMILYAMNAMENSP] = {
-               OperatorFamilyRelationId,
-               OpfamilyAmNameNspIndexId,
-               KEY(Anum_pg_opfamily_opfmethod,
-                       Anum_pg_opfamily_opfname,
-                       Anum_pg_opfamily_opfnamespace),
-               8
-       },
-       [OPFAMILYOID] = {
-               OperatorFamilyRelationId,
-               OpfamilyOidIndexId,
-               KEY(Anum_pg_opfamily_oid),
-               8
-       },
-       [PARAMETERACLNAME] = {
-               ParameterAclRelationId,
-               ParameterAclParnameIndexId,
-               KEY(Anum_pg_parameter_acl_parname),
-               4
-       },
-       [PARAMETERACLOID] = {
-               ParameterAclRelationId,
-               ParameterAclOidIndexId,
-               KEY(Anum_pg_parameter_acl_oid),
-               4
-       },
-       [PARTRELID] = {
-               PartitionedRelationId,
-               PartitionedRelidIndexId,
-               KEY(Anum_pg_partitioned_table_partrelid),
-               32
-       },
-       [PROCNAMEARGSNSP] = {
-               ProcedureRelationId,
-               ProcedureNameArgsNspIndexId,
-               KEY(Anum_pg_proc_proname,
-                       Anum_pg_proc_proargtypes,
-                       Anum_pg_proc_pronamespace),
-               128
-       },
-       [PROCOID] = {
-               ProcedureRelationId,
-               ProcedureOidIndexId,
-               KEY(Anum_pg_proc_oid),
-               128
-       },
-       [PUBLICATIONNAME] = {
-               PublicationRelationId,
-               PublicationNameIndexId,
-               KEY(Anum_pg_publication_pubname),
-               8
-       },
-       [PUBLICATIONNAMESPACE] = {
-               PublicationNamespaceRelationId,
-               PublicationNamespaceObjectIndexId,
-               KEY(Anum_pg_publication_namespace_oid),
-               64
-       },
-       [PUBLICATIONNAMESPACEMAP] = {
-               PublicationNamespaceRelationId,
-               PublicationNamespacePnnspidPnpubidIndexId,
-               KEY(Anum_pg_publication_namespace_pnnspid,
-                       Anum_pg_publication_namespace_pnpubid),
-               64
-       },
-       [PUBLICATIONOID] = {
-               PublicationRelationId,
-               PublicationObjectIndexId,
-               KEY(Anum_pg_publication_oid),
-               8
-       },
-       [PUBLICATIONREL] = {
-               PublicationRelRelationId,
-               PublicationRelObjectIndexId,
-               KEY(Anum_pg_publication_rel_oid),
-               64
-       },
-       [PUBLICATIONRELMAP] = {
-               PublicationRelRelationId,
-               PublicationRelPrrelidPrpubidIndexId,
-               KEY(Anum_pg_publication_rel_prrelid,
-                       Anum_pg_publication_rel_prpubid),
-               64
-       },
-       [RANGEMULTIRANGE] = {
-               RangeRelationId,
-               RangeMultirangeTypidIndexId,
-               KEY(Anum_pg_range_rngmultitypid),
-               4
-       },
-       [RANGETYPE] = {
-               RangeRelationId,
-               RangeTypidIndexId,
-               KEY(Anum_pg_range_rngtypid),
-               4
-       },
-       [RELNAMENSP] = {
-               RelationRelationId,
-               ClassNameNspIndexId,
-               KEY(Anum_pg_class_relname,
-                       Anum_pg_class_relnamespace),
-               128
-       },
-       [RELOID] = {
-               RelationRelationId,
-               ClassOidIndexId,
-               KEY(Anum_pg_class_oid),
-               128
-       },
-       [REPLORIGIDENT] = {
-               ReplicationOriginRelationId,
-               ReplicationOriginIdentIndex,
-               KEY(Anum_pg_replication_origin_roident),
-               16
-       },
-       [REPLORIGNAME] = {
-               ReplicationOriginRelationId,
-               ReplicationOriginNameIndex,
-               KEY(Anum_pg_replication_origin_roname),
-               16
-       },
-       [RULERELNAME] = {
-               RewriteRelationId,
-               RewriteRelRulenameIndexId,
-               KEY(Anum_pg_rewrite_ev_class,
-                       Anum_pg_rewrite_rulename),
-               8
-       },
-       [SEQRELID] = {
-               SequenceRelationId,
-               SequenceRelidIndexId,
-               KEY(Anum_pg_sequence_seqrelid),
-               32
-       },
-       [STATEXTDATASTXOID] = {
-               StatisticExtDataRelationId,
-               StatisticExtDataStxoidInhIndexId,
-               KEY(Anum_pg_statistic_ext_data_stxoid,
-                       Anum_pg_statistic_ext_data_stxdinherit),
-               4
-       },
-       [STATEXTNAMENSP] = {
-               StatisticExtRelationId,
-               StatisticExtNameIndexId,
-               KEY(Anum_pg_statistic_ext_stxname,
-                       Anum_pg_statistic_ext_stxnamespace),
-               4
-       },
-       [STATEXTOID] = {
-               StatisticExtRelationId,
-               StatisticExtOidIndexId,
-               KEY(Anum_pg_statistic_ext_oid),
-               4
-       },
-       [STATRELATTINH] = {
-               StatisticRelationId,
-               StatisticRelidAttnumInhIndexId,
-               KEY(Anum_pg_statistic_starelid,
-                       Anum_pg_statistic_staattnum,
-                       Anum_pg_statistic_stainherit),
-               128
-       },
-       [SUBSCRIPTIONNAME] = {
-               SubscriptionRelationId,
-               SubscriptionNameIndexId,
-               KEY(Anum_pg_subscription_subdbid,
-                       Anum_pg_subscription_subname),
-               4
-       },
-       [SUBSCRIPTIONOID] = {
-               SubscriptionRelationId,
-               SubscriptionObjectIndexId,
-               KEY(Anum_pg_subscription_oid),
-               4
-       },
-       [SUBSCRIPTIONRELMAP] = {
-               SubscriptionRelRelationId,
-               SubscriptionRelSrrelidSrsubidIndexId,
-               KEY(Anum_pg_subscription_rel_srrelid,
-                       Anum_pg_subscription_rel_srsubid),
-               64
-       },
-       [TABLESPACEOID] = {
-               TableSpaceRelationId,
-               TablespaceOidIndexId,
-               KEY(Anum_pg_tablespace_oid),
-               4
-       },
-       [TRFOID] = {
-               TransformRelationId,
-               TransformOidIndexId,
-               KEY(Anum_pg_transform_oid),
-               16
-       },
-       [TRFTYPELANG] = {
-               TransformRelationId,
-               TransformTypeLangIndexId,
-               KEY(Anum_pg_transform_trftype,
-                       Anum_pg_transform_trflang),
-               16
-       },
-       [TSCONFIGMAP] = {
-               TSConfigMapRelationId,
-               TSConfigMapIndexId,
-               KEY(Anum_pg_ts_config_map_mapcfg,
-                       Anum_pg_ts_config_map_maptokentype,
-                       Anum_pg_ts_config_map_mapseqno),
-               2
-       },
-       [TSCONFIGNAMENSP] = {
-               TSConfigRelationId,
-               TSConfigNameNspIndexId,
-               KEY(Anum_pg_ts_config_cfgname,
-                       Anum_pg_ts_config_cfgnamespace),
-               2
-       },
-       [TSCONFIGOID] = {
-               TSConfigRelationId,
-               TSConfigOidIndexId,
-               KEY(Anum_pg_ts_config_oid),
-               2
-       },
-       [TSDICTNAMENSP] = {
-               TSDictionaryRelationId,
-               TSDictionaryNameNspIndexId,
-               KEY(Anum_pg_ts_dict_dictname,
-                       Anum_pg_ts_dict_dictnamespace),
-               2
-       },
-       [TSDICTOID] = {
-               TSDictionaryRelationId,
-               TSDictionaryOidIndexId,
-               KEY(Anum_pg_ts_dict_oid),
-               2
-       },
-       [TSPARSERNAMENSP] = {
-               TSParserRelationId,
-               TSParserNameNspIndexId,
-               KEY(Anum_pg_ts_parser_prsname,
-                       Anum_pg_ts_parser_prsnamespace),
-               2
-       },
-       [TSPARSEROID] = {
-               TSParserRelationId,
-               TSParserOidIndexId,
-               KEY(Anum_pg_ts_parser_oid),
-               2
-       },
-       [TSTEMPLATENAMENSP] = {
-               TSTemplateRelationId,
-               TSTemplateNameNspIndexId,
-               KEY(Anum_pg_ts_template_tmplname,
-                       Anum_pg_ts_template_tmplnamespace),
-               2
-       },
-       [TSTEMPLATEOID] = {
-               TSTemplateRelationId,
-               TSTemplateOidIndexId,
-               KEY(Anum_pg_ts_template_oid),
-               2
-       },
-       [TYPENAMENSP] = {
-               TypeRelationId,
-               TypeNameNspIndexId,
-               KEY(Anum_pg_type_typname,
-                       Anum_pg_type_typnamespace),
-               64
-       },
-       [TYPEOID] = {
-               TypeRelationId,
-               TypeOidIndexId,
-               KEY(Anum_pg_type_oid),
-               64
-       },
-       [USERMAPPINGOID] = {
-               UserMappingRelationId,
-               UserMappingOidIndexId,
-               KEY(Anum_pg_user_mapping_oid),
-               2
-       },
-       [USERMAPPINGUSERSERVER] = {
-               UserMappingRelationId,
-               UserMappingUserServerIndexId,
-               KEY(Anum_pg_user_mapping_umuser,
-                       Anum_pg_user_mapping_umserver),
-               2
-       }
-};
+#include "catalog/syscache_info.h"
 
 StaticAssertDecl(lengthof(cacheinfo) == SysCacheSize,
                                 "SysCacheSize does not match syscache.c's array");
index 6b83d4c7e6e5c52baa21eca1e1854bae83cf2ca0..983574f2c4deb0de83ec1f96a2151276bd2e2792 100644 (file)
@@ -1,4 +1,6 @@
 /schemapg.h
+/syscache_ids.h
+/syscache_info.h
 /system_fk_info.h
 /pg_*_d.h
 /header-stamp
index 01cf31354ff0a9492866ef1d6dcd197e46a4e5a6..201c8c7ef9b76a817a1bfd43be87bb7a8a74a4f7 100644 (file)
 #define DECLARE_ARRAY_FOREIGN_KEY(cols,reftbl,refcols) extern int no_such_variable
 #define DECLARE_ARRAY_FOREIGN_KEY_OPT(cols,reftbl,refcols) extern int no_such_variable
 
+/*
+ * Create a syscache with the given name, index, and bucket size.  See
+ * syscache.c.
+ */
+#define MAKE_SYSCACHE(name,idxname,nbuckets) extern int no_such_variable
+
 /* The following are never defined; they are here only for documentation. */
 
 /*
index 2bcbe327cfe6068b8544db3992056534329dbd3c..6be76dca1dd99355dbb8d3a167a46c95bc200297 100644 (file)
@@ -102,8 +102,22 @@ bki_data_f = files(bki_data)
 
 
 input = []
-output_files = ['postgres.bki', 'system_constraints.sql', 'schemapg.h', 'system_fk_info.h']
-output_install = [dir_data, dir_data, dir_include_server / 'catalog', dir_include_server / 'catalog']
+output_files = [
+  'postgres.bki',
+  'system_constraints.sql',
+  'schemapg.h',
+  'syscache_ids.h',
+  'syscache_info.h',
+  'system_fk_info.h',
+]
+output_install = [
+  dir_data,
+  dir_data,
+  dir_include_server / 'catalog',
+  false,
+  dir_include_server / 'catalog',
+  dir_include_server / 'catalog',
+]
 
 foreach h : catalog_headers
   fname = h.split('.h')[0] + '_d.h'
index db72a1233b3cae98484ad8be9ae17cc81a321019..490f64546956ed6206a5db105dcdfed2b931a122 100644 (file)
@@ -112,6 +112,8 @@ DECLARE_TOAST(pg_aggregate, 4159, 4160);
 
 DECLARE_UNIQUE_INDEX_PKEY(pg_aggregate_fnoid_index, 2650, AggregateFnoidIndexId, pg_aggregate, btree(aggfnoid oid_ops));
 
+MAKE_SYSCACHE(AGGFNOID, pg_aggregate_fnoid_index, 16);
+
 #ifdef EXPOSE_TO_CLIENT_CODE
 
 /*
index e4bb61fc721fd2552599f32922fb7d11b970467b..475593fad4cab6fd9cebddfcc4dddc937bfd463c 100644 (file)
@@ -50,6 +50,9 @@ typedef FormData_pg_am *Form_pg_am;
 DECLARE_UNIQUE_INDEX(pg_am_name_index, 2651, AmNameIndexId, pg_am, btree(amname name_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_am_oid_index, 2652, AmOidIndexId, pg_am, btree(oid oid_ops));
 
+MAKE_SYSCACHE(AMNAME, pg_am_name_index, 4);
+MAKE_SYSCACHE(AMOID, pg_am_oid_index, 4);
+
 #ifdef EXPOSE_TO_CLIENT_CODE
 
 /*
index 8ea18a2fe1bc4480bc2b6713b0a7d002e2a8c870..570100fad418d0667e84194a0bc4325d41afb6e7 100644 (file)
@@ -91,6 +91,9 @@ DECLARE_UNIQUE_INDEX(pg_amop_fam_strat_index, 2653, AccessMethodStrategyIndexId,
 DECLARE_UNIQUE_INDEX(pg_amop_opr_fam_index, 2654, AccessMethodOperatorIndexId, pg_amop, btree(amopopr oid_ops, amoppurpose char_ops, amopfamily oid_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_amop_oid_index, 2756, AccessMethodOperatorOidIndexId, pg_amop, btree(oid oid_ops));
 
+MAKE_SYSCACHE(AMOPSTRATEGY, pg_amop_fam_strat_index, 64);
+MAKE_SYSCACHE(AMOPOPID, pg_amop_opr_fam_index, 64);
+
 #ifdef EXPOSE_TO_CLIENT_CODE
 
 /* allowed values of amoppurpose: */
index 43e8f5ef0d2e0f05bd2d7e1a151f84c2d3e3f51d..1dbebeca1752c19f3555d5605ed4e6d6dc6839c3 100644 (file)
@@ -70,4 +70,6 @@ typedef FormData_pg_amproc *Form_pg_amproc;
 DECLARE_UNIQUE_INDEX(pg_amproc_fam_proc_index, 2655, AccessMethodProcedureIndexId, pg_amproc, btree(amprocfamily oid_ops, amproclefttype oid_ops, amprocrighttype oid_ops, amprocnum int2_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_amproc_oid_index, 2757, AccessMethodProcedureOidIndexId, pg_amproc, btree(oid oid_ops));
 
+MAKE_SYSCACHE(AMPROCNUM, pg_amproc_fam_proc_index, 16);
+
 #endif                                                 /* PG_AMPROC_H */
index e2aadb941413d6a797ead54c2dfcb380324de5ee..9f2706c4e870c9e39f3706f1f45072d6a3791813 100644 (file)
@@ -211,6 +211,9 @@ typedef FormData_pg_attribute *Form_pg_attribute;
 DECLARE_UNIQUE_INDEX(pg_attribute_relid_attnam_index, 2658, AttributeRelidNameIndexId, pg_attribute, btree(attrelid oid_ops, attname name_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_attribute_relid_attnum_index, 2659, AttributeRelidNumIndexId, pg_attribute, btree(attrelid oid_ops, attnum int2_ops));
 
+MAKE_SYSCACHE(ATTNAME, pg_attribute_relid_attnam_index, 32);
+MAKE_SYSCACHE(ATTNUM, pg_attribute_relid_attnum_index, 128);
+
 #ifdef EXPOSE_TO_CLIENT_CODE
 
 #define                  ATTRIBUTE_IDENTITY_ALWAYS             'a'
index c6f0782f46801f6d23b4baf935eeef3fc184c665..5f4b30756ca658b2d45414f4df66d40bb4682724 100644 (file)
@@ -50,4 +50,7 @@ DECLARE_UNIQUE_INDEX(pg_auth_members_role_member_index, 2694, AuthMemRoleMemInde
 DECLARE_UNIQUE_INDEX(pg_auth_members_member_role_index, 2695, AuthMemMemRoleIndexId, pg_auth_members, btree(member oid_ops, roleid oid_ops, grantor oid_ops));
 DECLARE_INDEX(pg_auth_members_grantor_index, 6302, AuthMemGrantorIndexId, pg_auth_members, btree(grantor oid_ops));
 
+MAKE_SYSCACHE(AUTHMEMROLEMEM, pg_auth_members_role_member_index, 8);
+MAKE_SYSCACHE(AUTHMEMMEMROLE, pg_auth_members_member_role_index, 8);
+
 #endif                                                 /* PG_AUTH_MEMBERS_H */
index 6a177d1b7db3408f7998a2f93bb41eb7af07214f..e08863f78abde5cdb4c34fd8939a03aec2919e22 100644 (file)
@@ -60,4 +60,7 @@ DECLARE_TOAST_WITH_MACRO(pg_authid, 4175, 4176, PgAuthidToastTable, PgAuthidToas
 DECLARE_UNIQUE_INDEX(pg_authid_rolname_index, 2676, AuthIdRolnameIndexId, pg_authid, btree(rolname name_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_authid_oid_index, 2677, AuthIdOidIndexId, pg_authid, btree(oid oid_ops));
 
+MAKE_SYSCACHE(AUTHNAME, pg_authid_rolname_index, 8);
+MAKE_SYSCACHE(AUTHOID, pg_authid_oid_index, 8);
+
 #endif                                                 /* PG_AUTHID_H */
index 67bcc11619a6b72bc7c84df1090f8c950a45a16e..6c995509bc38866db61fad4fc97cb1ae4c8e90d4 100644 (file)
@@ -59,6 +59,8 @@ typedef FormData_pg_cast *Form_pg_cast;
 DECLARE_UNIQUE_INDEX_PKEY(pg_cast_oid_index, 2660, CastOidIndexId, pg_cast, btree(oid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_cast_source_target_index, 2661, CastSourceTargetIndexId, pg_cast, btree(castsource oid_ops, casttarget oid_ops));
 
+MAKE_SYSCACHE(CASTSOURCETARGET, pg_cast_source_target_index, 256);
+
 #ifdef EXPOSE_TO_CLIENT_CODE
 
 /*
index 4f24d9a92f56392be4b31f5563482812a64271f8..3b7533e7bb3ba6c1e2074dbe68eed7bbf4c1a4a3 100644 (file)
@@ -156,6 +156,9 @@ DECLARE_UNIQUE_INDEX_PKEY(pg_class_oid_index, 2662, ClassOidIndexId, pg_class, b
 DECLARE_UNIQUE_INDEX(pg_class_relname_nsp_index, 2663, ClassNameNspIndexId, pg_class, btree(relname name_ops, relnamespace oid_ops));
 DECLARE_INDEX(pg_class_tblspc_relfilenode_index, 3455, ClassTblspcRelfilenodeIndexId, pg_class, btree(reltablespace oid_ops, relfilenode oid_ops));
 
+MAKE_SYSCACHE(RELOID, pg_class_oid_index, 128);
+MAKE_SYSCACHE(RELNAMENSP, pg_class_relname_nsp_index, 128);
+
 #ifdef EXPOSE_TO_CLIENT_CODE
 
 #define                  RELKIND_RELATION                'r'   /* ordinary table */
index 744e64c777015185b00a9b8d068645481be65fd6..5f08eb0a4afb25d24b145536047164783543aba6 100644 (file)
@@ -62,6 +62,9 @@ DECLARE_TOAST(pg_collation, 6175, 6176);
 DECLARE_UNIQUE_INDEX(pg_collation_name_enc_nsp_index, 3164, CollationNameEncNspIndexId, pg_collation, btree(collname name_ops, collencoding int4_ops, collnamespace oid_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_collation_oid_index, 3085, CollationOidIndexId, pg_collation, btree(oid oid_ops));
 
+MAKE_SYSCACHE(COLLNAMEENCNSP, pg_collation_name_enc_nsp_index, 8);
+MAKE_SYSCACHE(COLLOID, pg_collation_oid_index, 8);
+
 #ifdef EXPOSE_TO_CLIENT_CODE
 
 #define COLLPROVIDER_DEFAULT   'd'
index d79432e142b9ffe9108df413146e5a7084f13df5..c693091d426469f9b831b2fef64f80d1cdac9fa6 100644 (file)
@@ -172,6 +172,8 @@ DECLARE_INDEX(pg_constraint_contypid_index, 2666, ConstraintTypidIndexId, pg_con
 DECLARE_UNIQUE_INDEX_PKEY(pg_constraint_oid_index, 2667, ConstraintOidIndexId, pg_constraint, btree(oid oid_ops));
 DECLARE_INDEX(pg_constraint_conparentid_index, 2579, ConstraintParentIndexId, pg_constraint, btree(conparentid oid_ops));
 
+MAKE_SYSCACHE(CONSTROID, pg_constraint_oid_index, 16);
+
 /* conkey can contain zero (InvalidAttrNumber) if a whole-row Var is used */
 DECLARE_ARRAY_FOREIGN_KEY_OPT((conrelid, conkey), pg_attribute, (attrelid, attnum));
 DECLARE_ARRAY_FOREIGN_KEY((confrelid, confkey), pg_attribute, (attrelid, attnum));
index cdbc03b915b623bb2f5fb7666e22c023624629b6..d94f022967256715d1801b589a152f1490447b0d 100644 (file)
@@ -64,6 +64,10 @@ DECLARE_UNIQUE_INDEX(pg_conversion_default_index, 2668, ConversionDefaultIndexId
 DECLARE_UNIQUE_INDEX(pg_conversion_name_nsp_index, 2669, ConversionNameNspIndexId, pg_conversion, btree(conname name_ops, connamespace oid_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_conversion_oid_index, 2670, ConversionOidIndexId, pg_conversion, btree(oid oid_ops));
 
+MAKE_SYSCACHE(CONDEFAULT, pg_conversion_default_index, 8);
+MAKE_SYSCACHE(CONNAMENSP, pg_conversion_name_nsp_index, 8);
+MAKE_SYSCACHE(CONVOID, pg_conversion_oid_index, 8);
+
 
 extern ObjectAddress ConversionCreate(const char *conname, Oid connamespace,
                                                                          Oid conowner,
index f0ed776b603017871a10517336ea50d63499f843..014baa7babac7433f0be0b3bb79962a5cf5ce46c 100644 (file)
@@ -100,6 +100,8 @@ DECLARE_TOAST_WITH_MACRO(pg_database, 4177, 4178, PgDatabaseToastTable, PgDataba
 DECLARE_UNIQUE_INDEX(pg_database_datname_index, 2671, DatabaseNameIndexId, pg_database, btree(datname name_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_database_oid_index, 2672, DatabaseOidIndexId, pg_database, btree(oid oid_ops));
 
+MAKE_SYSCACHE(DATABASEOID, pg_database_oid_index, 4);
+
 /*
  * pg_database.dat contains an entry for template1, but not for the template0
  * or postgres databases, because those are created later in initdb.
index c52ad381edb78cea85042c717ddfa21d16e9db11..d272cdf08b476d60e1cd4aeab549a4fb9b46bfee 100644 (file)
@@ -54,6 +54,8 @@ DECLARE_TOAST(pg_default_acl, 4143, 4144);
 DECLARE_UNIQUE_INDEX(pg_default_acl_role_nsp_obj_index, 827, DefaultAclRoleNspObjIndexId, pg_default_acl, btree(defaclrole oid_ops, defaclnamespace oid_ops, defaclobjtype char_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_default_acl_oid_index, 828, DefaultAclOidIndexId, pg_default_acl, btree(oid oid_ops));
 
+MAKE_SYSCACHE(DEFACLROLENSPOBJ, pg_default_acl_role_nsp_obj_index, 8);
+
 #ifdef EXPOSE_TO_CLIENT_CODE
 
 /*
index 6a05fc8ca2b62d04ade75f80132fcbe72ab372f9..4d9a241d34890b5ba1c45ce3a88eaa6ea82b24f8 100644 (file)
@@ -47,6 +47,9 @@ DECLARE_UNIQUE_INDEX_PKEY(pg_enum_oid_index, 3502, EnumOidIndexId, pg_enum, btre
 DECLARE_UNIQUE_INDEX(pg_enum_typid_label_index, 3503, EnumTypIdLabelIndexId, pg_enum, btree(enumtypid oid_ops, enumlabel name_ops));
 DECLARE_UNIQUE_INDEX(pg_enum_typid_sortorder_index, 3534, EnumTypIdSortOrderIndexId, pg_enum, btree(enumtypid oid_ops, enumsortorder float4_ops));
 
+MAKE_SYSCACHE(ENUMOID, pg_enum_oid_index, 8);
+MAKE_SYSCACHE(ENUMTYPOIDNAME, pg_enum_typid_label_index, 8);
+
 /*
  * prototypes for functions in pg_enum.c
  */
index d8e99da37db0f4af44fb0a548ca98f4bb813fa01..9170a4ddfe80fc0e1cc8a09dbe8bdb638a3acf6f 100644 (file)
@@ -54,4 +54,7 @@ DECLARE_TOAST(pg_event_trigger, 4145, 4146);
 DECLARE_UNIQUE_INDEX(pg_event_trigger_evtname_index, 3467, EventTriggerNameIndexId, pg_event_trigger, btree(evtname name_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_event_trigger_oid_index, 3468, EventTriggerOidIndexId, pg_event_trigger, btree(oid oid_ops));
 
+MAKE_SYSCACHE(EVENTTRIGGERNAME, pg_event_trigger_evtname_index, 8);
+MAKE_SYSCACHE(EVENTTRIGGEROID, pg_event_trigger_oid_index, 8);
+
 #endif                                                 /* PG_EVENT_TRIGGER_H */
index 5e39e4b42f8871beed30f7778148f5a939284b85..0d8759d3fd3852703e67713334ddad729ae3ee0e 100644 (file)
@@ -55,4 +55,7 @@ DECLARE_TOAST(pg_foreign_data_wrapper, 4149, 4150);
 DECLARE_UNIQUE_INDEX_PKEY(pg_foreign_data_wrapper_oid_index, 112, ForeignDataWrapperOidIndexId, pg_foreign_data_wrapper, btree(oid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_foreign_data_wrapper_name_index, 548, ForeignDataWrapperNameIndexId, pg_foreign_data_wrapper, btree(fdwname name_ops));
 
+MAKE_SYSCACHE(FOREIGNDATAWRAPPEROID, pg_foreign_data_wrapper_oid_index, 2);
+MAKE_SYSCACHE(FOREIGNDATAWRAPPERNAME, pg_foreign_data_wrapper_name_index, 2);
+
 #endif                                                 /* PG_FOREIGN_DATA_WRAPPER_H */
index 995f140bf35019db2e11b1be74c3c737408f903e..a4b81936b0954d42d7e81120c7fcb59d1d778337 100644 (file)
@@ -52,4 +52,7 @@ DECLARE_TOAST(pg_foreign_server, 4151, 4152);
 DECLARE_UNIQUE_INDEX_PKEY(pg_foreign_server_oid_index, 113, ForeignServerOidIndexId, pg_foreign_server, btree(oid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_foreign_server_name_index, 549, ForeignServerNameIndexId, pg_foreign_server, btree(srvname name_ops));
 
+MAKE_SYSCACHE(FOREIGNSERVEROID, pg_foreign_server_oid_index, 2);
+MAKE_SYSCACHE(FOREIGNSERVERNAME, pg_foreign_server_name_index, 2);
+
 #endif                                                 /* PG_FOREIGN_SERVER_H */
index 19e7373b0277c1d3ae58b6349fb637e74a436df0..d17ff0e76e18bd356d5ff299c181646892407202 100644 (file)
@@ -46,4 +46,6 @@ DECLARE_TOAST(pg_foreign_table, 4153, 4154);
 
 DECLARE_UNIQUE_INDEX_PKEY(pg_foreign_table_relid_index, 3119, ForeignTableRelidIndexId, pg_foreign_table, btree(ftrelid oid_ops));
 
+MAKE_SYSCACHE(FOREIGNTABLEREL, pg_foreign_table_relid_index, 4);
+
 #endif                                                 /* PG_FOREIGN_TABLE_H */
index e4f3f708071d4288b75e4162f0afc2c1e4118700..3462572eb55bbcfb9a6c4fad8d37c50322a4f519 100644 (file)
@@ -72,6 +72,8 @@ typedef FormData_pg_index *Form_pg_index;
 DECLARE_INDEX(pg_index_indrelid_index, 2678, IndexIndrelidIndexId, pg_index, btree(indrelid oid_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_index_indexrelid_index, 2679, IndexRelidIndexId, pg_index, btree(indexrelid oid_ops));
 
+MAKE_SYSCACHE(INDEXRELID, pg_index_indexrelid_index, 64);
+
 /* indkey can contain zero (InvalidAttrNumber) to represent expressions */
 DECLARE_ARRAY_FOREIGN_KEY_OPT((indrelid, indkey), pg_attribute, (attrelid, attnum));
 
index 581372addd488fe9142c2d8c680a4200be4bd2cf..7256908a95c8aa17bc7ca46d68dd76dee4ffbd81 100644 (file)
@@ -69,4 +69,7 @@ DECLARE_TOAST(pg_language, 4157, 4158);
 DECLARE_UNIQUE_INDEX(pg_language_name_index, 2681, LanguageNameIndexId, pg_language, btree(lanname name_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_language_oid_index, 2682, LanguageOidIndexId, pg_language, btree(oid oid_ops));
 
+MAKE_SYSCACHE(LANGNAME, pg_language_name_index, 4);
+MAKE_SYSCACHE(LANGOID, pg_language_oid_index, 4);
+
 #endif                                                 /* PG_LANGUAGE_H */
index abae5e2824b3431315134fd90181cf9a94b7253e..e101808ae1e0b621b93ab495711a8f38f9f0493d 100644 (file)
@@ -56,6 +56,9 @@ DECLARE_TOAST(pg_namespace, 4163, 4164);
 DECLARE_UNIQUE_INDEX(pg_namespace_nspname_index, 2684, NamespaceNameIndexId, pg_namespace, btree(nspname name_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_namespace_oid_index, 2685, NamespaceOidIndexId, pg_namespace, btree(oid oid_ops));
 
+MAKE_SYSCACHE(NAMESPACENAME, pg_namespace_nspname_index, 4);
+MAKE_SYSCACHE(NAMESPACEOID, pg_namespace_oid_index, 16);
+
 /*
  * prototypes for functions in pg_namespace.c
  */
index 9cbdab52b16cef88e6fe72f67e11bcb59cd21c0d..05867d08f9312c01f038e6914d5abb4c5edb2d00 100644 (file)
@@ -85,4 +85,7 @@ typedef FormData_pg_opclass *Form_pg_opclass;
 DECLARE_UNIQUE_INDEX(pg_opclass_am_name_nsp_index, 2686, OpclassAmNameNspIndexId, pg_opclass, btree(opcmethod oid_ops, opcname name_ops, opcnamespace oid_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_opclass_oid_index, 2687, OpclassOidIndexId, pg_opclass, btree(oid oid_ops));
 
+MAKE_SYSCACHE(CLAAMNAMENSP, pg_opclass_am_name_nsp_index, 8);
+MAKE_SYSCACHE(CLAOID, pg_opclass_oid_index, 8);
+
 #endif                                                 /* PG_OPCLASS_H */
index 7d6bbbb90f076deda2d165b6e34e9f38c1841a43..3ff1acc37ef9e9216db8e3e06019003baa0b6610 100644 (file)
@@ -85,6 +85,8 @@ typedef FormData_pg_operator *Form_pg_operator;
 DECLARE_UNIQUE_INDEX_PKEY(pg_operator_oid_index, 2688, OperatorOidIndexId, pg_operator, btree(oid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_operator_oprname_l_r_n_index, 2689, OperatorNameNspIndexId, pg_operator, btree(oprname name_ops, oprleft oid_ops, oprright oid_ops, oprnamespace oid_ops));
 
+MAKE_SYSCACHE(OPEROID, pg_operator_oid_index, 32);
+MAKE_SYSCACHE(OPERNAMENSP, pg_operator_oprname_l_r_n_index, 256);
 
 extern Oid     OperatorLookup(List *operatorName,
                                                   Oid leftObjectId,
index c974f41d95296b3d4498f3845f4ffc8943b1c1e8..52f9c4acf976bdfb345a4766234d8e6a4c4dc22c 100644 (file)
@@ -53,6 +53,9 @@ typedef FormData_pg_opfamily *Form_pg_opfamily;
 DECLARE_UNIQUE_INDEX(pg_opfamily_am_name_nsp_index, 2754, OpfamilyAmNameNspIndexId, pg_opfamily, btree(opfmethod oid_ops, opfname name_ops, opfnamespace oid_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_opfamily_oid_index, 2755, OpfamilyOidIndexId, pg_opfamily, btree(oid oid_ops));
 
+MAKE_SYSCACHE(OPFAMILYAMNAMENSP, pg_opfamily_am_name_nsp_index, 8);
+MAKE_SYSCACHE(OPFAMILYOID, pg_opfamily_oid_index, 8);
+
 #ifdef EXPOSE_TO_CLIENT_CODE
 
 /* This does not account for non-core opfamilies that might accept boolean */
index 09c51e5d34ab99b3ad29a2b9df450f9ea5e543b0..8f6b6f92b3e6ea2b18c33331525fd006bafa6027 100644 (file)
@@ -53,6 +53,8 @@ DECLARE_TOAST_WITH_MACRO(pg_parameter_acl, 6244, 6245, PgParameterAclToastTable,
 DECLARE_UNIQUE_INDEX(pg_parameter_acl_parname_index, 6246, ParameterAclParnameIndexId, pg_parameter_acl, btree(parname text_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_parameter_acl_oid_index, 6247, ParameterAclOidIndexId, pg_parameter_acl, btree(oid oid_ops));
 
+MAKE_SYSCACHE(PARAMETERACLNAME, pg_parameter_acl_parname_index, 4);
+MAKE_SYSCACHE(PARAMETERACLOID, pg_parameter_acl_oid_index, 4);
 
 extern Oid     ParameterAclLookup(const char *parameter, bool missing_ok);
 extern Oid     ParameterAclCreate(const char *parameter);
index bd6798e3ad4d97e4e1f09e1f6f2ac6fc10d73f3d..daf57008b6963d849e52e2fd86a5c2efea567f64 100644 (file)
@@ -68,6 +68,8 @@ DECLARE_TOAST(pg_partitioned_table, 4165, 4166);
 
 DECLARE_UNIQUE_INDEX_PKEY(pg_partitioned_table_partrelid_index, 3351, PartitionedRelidIndexId, pg_partitioned_table, btree(partrelid oid_ops));
 
+MAKE_SYSCACHE(PARTRELID, pg_partitioned_table_partrelid_index, 32);
+
 /* partattrs can contain zero (InvalidAttrNumber) to represent expressions */
 DECLARE_ARRAY_FOREIGN_KEY_OPT((partrelid, partattrs), pg_attribute, (attrelid, attnum));
 
index 24f743329d9289eb0df250d0a952bb3d1e999bcc..51f43092415e972a63537a0066bc02001c68b84f 100644 (file)
@@ -140,6 +140,9 @@ DECLARE_TOAST(pg_proc, 2836, 2837);
 DECLARE_UNIQUE_INDEX_PKEY(pg_proc_oid_index, 2690, ProcedureOidIndexId, pg_proc, btree(oid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_proc_proname_args_nsp_index, 2691, ProcedureNameArgsNspIndexId, pg_proc, btree(proname name_ops, proargtypes oidvector_ops, pronamespace oid_ops));
 
+MAKE_SYSCACHE(PROCOID, pg_proc_oid_index, 128);
+MAKE_SYSCACHE(PROCNAMEARGSNSP, pg_proc_proname_args_nsp_index, 128);
+
 #ifdef EXPOSE_TO_CLIENT_CODE
 
 /*
index 6e9bbe80ffc6d888171d897b829fbc7332281947..2f1b6abbfa7c68ad194ce93880e3a0f34f30382c 100644 (file)
@@ -66,6 +66,9 @@ typedef FormData_pg_publication *Form_pg_publication;
 DECLARE_UNIQUE_INDEX_PKEY(pg_publication_oid_index, 6110, PublicationObjectIndexId, pg_publication, btree(oid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_publication_pubname_index, 6111, PublicationNameIndexId, pg_publication, btree(pubname name_ops));
 
+MAKE_SYSCACHE(PUBLICATIONOID, pg_publication_oid_index, 8);
+MAKE_SYSCACHE(PUBLICATIONNAME, pg_publication_pubname_index, 8);
+
 typedef struct PublicationActions
 {
        bool            pubinsert;
index 92aa58c1ed0b3fb4a5161e747d5fa90725f507f7..1cfb557684f9f42ace85d1cd1774dbbe029cbb01 100644 (file)
@@ -44,4 +44,7 @@ typedef FormData_pg_publication_namespace *Form_pg_publication_namespace;
 DECLARE_UNIQUE_INDEX_PKEY(pg_publication_namespace_oid_index, 6238, PublicationNamespaceObjectIndexId, pg_publication_namespace, btree(oid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_publication_namespace_pnnspid_pnpubid_index, 6239, PublicationNamespacePnnspidPnpubidIndexId, pg_publication_namespace, btree(pnnspid oid_ops, pnpubid oid_ops));
 
+MAKE_SYSCACHE(PUBLICATIONNAMESPACE, pg_publication_namespace_oid_index, 64);
+MAKE_SYSCACHE(PUBLICATIONNAMESPACEMAP, pg_publication_namespace_pnnspid_pnpubid_index, 64);
+
 #endif                                                 /* PG_PUBLICATION_NAMESPACE_H */
index 8219e854170b0d94875061b664f09508a2c73f9a..25fa630675aaa3d7ebd81867f58f36c7a69c4c2a 100644 (file)
@@ -51,4 +51,7 @@ DECLARE_UNIQUE_INDEX_PKEY(pg_publication_rel_oid_index, 6112, PublicationRelObje
 DECLARE_UNIQUE_INDEX(pg_publication_rel_prrelid_prpubid_index, 6113, PublicationRelPrrelidPrpubidIndexId, pg_publication_rel, btree(prrelid oid_ops, prpubid oid_ops));
 DECLARE_INDEX(pg_publication_rel_prpubid_index, 6116, PublicationRelPrpubidIndexId, pg_publication_rel, btree(prpubid oid_ops));
 
+MAKE_SYSCACHE(PUBLICATIONREL, pg_publication_rel_oid_index, 64);
+MAKE_SYSCACHE(PUBLICATIONRELMAP, pg_publication_rel_prrelid_prpubid_index, 64);
+
 #endif                                                 /* PG_PUBLICATION_REL_H */
index a1f527130bf7e78ea9d6628cd28a2c310fa5199e..0bd3ab688bd8561a77d4be8e3b15854a74f28250 100644 (file)
@@ -60,6 +60,9 @@ typedef FormData_pg_range *Form_pg_range;
 DECLARE_UNIQUE_INDEX_PKEY(pg_range_rngtypid_index, 3542, RangeTypidIndexId, pg_range, btree(rngtypid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_range_rngmultitypid_index, 2228, RangeMultirangeTypidIndexId, pg_range, btree(rngmultitypid oid_ops));
 
+MAKE_SYSCACHE(RANGETYPE, pg_range_rngtypid_index, 4);
+MAKE_SYSCACHE(RANGEMULTIRANGE, pg_range_rngmultitypid_index, 4);
+
 /*
  * prototypes for functions in pg_range.c
  */
index 0280aa2f76849a1c9899dd383e724509b40743d9..e9bc0209c2667ef6294e54802d9c7100c4811714 100644 (file)
@@ -59,4 +59,7 @@ DECLARE_TOAST_WITH_MACRO(pg_replication_origin, 4181, 4182, PgReplicationOriginT
 DECLARE_UNIQUE_INDEX_PKEY(pg_replication_origin_roiident_index, 6001, ReplicationOriginIdentIndex, pg_replication_origin, btree(roident oid_ops));
 DECLARE_UNIQUE_INDEX(pg_replication_origin_roname_index, 6002, ReplicationOriginNameIndex, pg_replication_origin, btree(roname text_ops));
 
+MAKE_SYSCACHE(REPLORIGIDENT, pg_replication_origin_roiident_index, 16);
+MAKE_SYSCACHE(REPLORIGNAME, pg_replication_origin_roname_index, 16);
+
 #endif                                                 /* PG_REPLICATION_ORIGIN_H */
index c346c5b384de43dd0e71fe0fc2d4b3e0acd9de05..e42ff73d29c3260e968351bc0ed46efb3f88f63a 100644 (file)
@@ -56,4 +56,6 @@ DECLARE_TOAST(pg_rewrite, 2838, 2839);
 DECLARE_UNIQUE_INDEX_PKEY(pg_rewrite_oid_index, 2692, RewriteOidIndexId, pg_rewrite, btree(oid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_rewrite_rel_rulename_index, 2693, RewriteRelRulenameIndexId, pg_rewrite, btree(ev_class oid_ops, rulename name_ops));
 
+MAKE_SYSCACHE(RULERELNAME, pg_rewrite_rel_rulename_index, 8);
+
 #endif                                                 /* PG_REWRITE_H */
index 3fba57a739742bd750602097cb72eff28694ab61..8c3f0dd1ab897ff650596a0db608e2992d28b8a5 100644 (file)
@@ -41,4 +41,6 @@ typedef FormData_pg_sequence *Form_pg_sequence;
 
 DECLARE_UNIQUE_INDEX_PKEY(pg_sequence_seqrelid_index, 5002, SequenceRelidIndexId, pg_sequence, btree(seqrelid oid_ops));
 
+MAKE_SYSCACHE(SEQRELID, pg_sequence_seqrelid_index, 32);
+
 #endif                                                 /* PG_SEQUENCE_H */
index 949a103f9ff18d2e4ab9aa4ee650527fdeed1054..041e626390a1551ffb3dc131cb08031016a88dd3 100644 (file)
@@ -138,6 +138,8 @@ DECLARE_TOAST(pg_statistic, 2840, 2841);
 
 DECLARE_UNIQUE_INDEX_PKEY(pg_statistic_relid_att_inh_index, 2696, StatisticRelidAttnumInhIndexId, pg_statistic, btree(starelid oid_ops, staattnum int2_ops, stainherit bool_ops));
 
+MAKE_SYSCACHE(STATRELATTINH, pg_statistic_relid_att_inh_index, 128);
+
 DECLARE_FOREIGN_KEY((starelid, staattnum), pg_attribute, (attrelid, attnum));
 
 #ifdef EXPOSE_TO_CLIENT_CODE
index 104b7db1f95e71052a10a31bce4e477742fb04b5..85064086ec5519f2fa7aa5381fe4c888c2b056b0 100644 (file)
@@ -74,6 +74,9 @@ DECLARE_UNIQUE_INDEX_PKEY(pg_statistic_ext_oid_index, 3380, StatisticExtOidIndex
 DECLARE_UNIQUE_INDEX(pg_statistic_ext_name_index, 3997, StatisticExtNameIndexId, pg_statistic_ext, btree(stxname name_ops, stxnamespace oid_ops));
 DECLARE_INDEX(pg_statistic_ext_relid_index, 3379, StatisticExtRelidIndexId, pg_statistic_ext, btree(stxrelid oid_ops));
 
+MAKE_SYSCACHE(STATEXTOID, pg_statistic_ext_oid_index, 4);
+MAKE_SYSCACHE(STATEXTNAMENSP, pg_statistic_ext_name_index, 4);
+
 DECLARE_ARRAY_FOREIGN_KEY((stxrelid, stxkeys), pg_attribute, (attrelid, attnum));
 
 #ifdef EXPOSE_TO_CLIENT_CODE
index 48c5c2d122592a504dd9bb5684988a0b1029274b..18b00ce8b526a4bab77707a0c65a263f4cf019bc 100644 (file)
@@ -56,5 +56,6 @@ DECLARE_TOAST(pg_statistic_ext_data, 3430, 3431);
 
 DECLARE_UNIQUE_INDEX_PKEY(pg_statistic_ext_data_stxoid_inh_index, 3433, StatisticExtDataStxoidInhIndexId, pg_statistic_ext_data, btree(stxoid oid_ops, stxdinherit bool_ops));
 
+MAKE_SYSCACHE(STATEXTDATASTXOID, pg_statistic_ext_data_stxoid_inh_index, 4);
 
 #endif                                                 /* PG_STATISTIC_EXT_DATA_H */
index ca326255852a245d8e42838c586517a4d149a902..ab206bad7ded524e99634c60917c3aef227c8862 100644 (file)
@@ -118,6 +118,9 @@ DECLARE_TOAST_WITH_MACRO(pg_subscription, 4183, 4184, PgSubscriptionToastTable,
 DECLARE_UNIQUE_INDEX_PKEY(pg_subscription_oid_index, 6114, SubscriptionObjectIndexId, pg_subscription, btree(oid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_subscription_subname_index, 6115, SubscriptionNameIndexId, pg_subscription, btree(subdbid oid_ops, subname name_ops));
 
+MAKE_SYSCACHE(SUBSCRIPTIONOID, pg_subscription_oid_index, 4);
+MAKE_SYSCACHE(SUBSCRIPTIONNAME, pg_subscription_subname_index, 4);
+
 typedef struct Subscription
 {
        Oid                     oid;                    /* Oid of the subscription */
index fbedb0fedbf314772ea374b08ac35950b7f575e9..8244ad537aea9d3989125e877fbc7ef5ad91fc6e 100644 (file)
@@ -51,6 +51,8 @@ typedef FormData_pg_subscription_rel *Form_pg_subscription_rel;
 
 DECLARE_UNIQUE_INDEX_PKEY(pg_subscription_rel_srrelid_srsubid_index, 6117, SubscriptionRelSrrelidSrsubidIndexId, pg_subscription_rel, btree(srrelid oid_ops, srsubid oid_ops));
 
+MAKE_SYSCACHE(SUBSCRIPTIONRELMAP, pg_subscription_rel_srrelid_srsubid_index, 64);
+
 #ifdef EXPOSE_TO_CLIENT_CODE
 
 /* ----------------
index db3edd7eb20bb75257aeeb738799319c0fe996cb..6b9bdcf8b05ecc56411b7bc590c4ac0212a3ff5c 100644 (file)
@@ -52,4 +52,6 @@ DECLARE_TOAST_WITH_MACRO(pg_tablespace, 4185, 4186, PgTablespaceToastTable, PgTa
 DECLARE_UNIQUE_INDEX_PKEY(pg_tablespace_oid_index, 2697, TablespaceOidIndexId, pg_tablespace, btree(oid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_tablespace_spcname_index, 2698, TablespaceNameIndexId, pg_tablespace, btree(spcname name_ops));
 
+MAKE_SYSCACHE(TABLESPACEOID, pg_tablespace_oid_index, 4);
+
 #endif                                                 /* PG_TABLESPACE_H */
index 33cc8c74c01c10953289d8d70011e4b8b90dcc7a..3b69960af60462140e550d6b6e7c080b3ad0dc26 100644 (file)
@@ -45,4 +45,7 @@ typedef FormData_pg_transform *Form_pg_transform;
 DECLARE_UNIQUE_INDEX_PKEY(pg_transform_oid_index, 3574, TransformOidIndexId, pg_transform, btree(oid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_transform_type_lang_index, 3575, TransformTypeLangIndexId, pg_transform, btree(trftype oid_ops, trflang oid_ops));
 
+MAKE_SYSCACHE(TRFOID, pg_transform_oid_index, 16);
+MAKE_SYSCACHE(TRFTYPELANG, pg_transform_type_lang_index, 16);
+
 #endif                                                 /* PG_TRANSFORM_H */
index 8fdf9ee27b1363c5469d3c7cac7e89e93fd26068..fc0bf447b1d078987c2a22f16f37b3f6794f4310 100644 (file)
@@ -50,4 +50,7 @@ typedef FormData_pg_ts_config *Form_pg_ts_config;
 DECLARE_UNIQUE_INDEX(pg_ts_config_cfgname_index, 3608, TSConfigNameNspIndexId, pg_ts_config, btree(cfgname name_ops, cfgnamespace oid_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_ts_config_oid_index, 3712, TSConfigOidIndexId, pg_ts_config, btree(oid oid_ops));
 
+MAKE_SYSCACHE(TSCONFIGNAMENSP, pg_ts_config_cfgname_index, 2);
+MAKE_SYSCACHE(TSCONFIGOID, pg_ts_config_oid_index, 2);
+
 #endif                                                 /* PG_TS_CONFIG_H */
index fa5813a32d58a0ee95384165ad532d421a770a0e..efced44941dd6a5b07ad0ecf60472f1bdc99893d 100644 (file)
@@ -46,4 +46,6 @@ typedef FormData_pg_ts_config_map *Form_pg_ts_config_map;
 
 DECLARE_UNIQUE_INDEX_PKEY(pg_ts_config_map_index, 3609, TSConfigMapIndexId, pg_ts_config_map, btree(mapcfg oid_ops, maptokentype int4_ops, mapseqno int4_ops));
 
+MAKE_SYSCACHE(TSCONFIGMAP, pg_ts_config_map_index, 2);
+
 #endif                                                 /* PG_TS_CONFIG_MAP_H */
index 69b22021c56ce7c5d3c8b4226c0cc69d1d532322..1320468de0e1d968c0b5464cece4cee329c750d7 100644 (file)
@@ -56,4 +56,7 @@ DECLARE_TOAST(pg_ts_dict, 4169, 4170);
 DECLARE_UNIQUE_INDEX(pg_ts_dict_dictname_index, 3604, TSDictionaryNameNspIndexId, pg_ts_dict, btree(dictname name_ops, dictnamespace oid_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_ts_dict_oid_index, 3605, TSDictionaryOidIndexId, pg_ts_dict, btree(oid oid_ops));
 
+MAKE_SYSCACHE(TSDICTNAMENSP, pg_ts_dict_dictname_index, 2);
+MAKE_SYSCACHE(TSDICTOID, pg_ts_dict_oid_index, 2);
+
 #endif                                                 /* PG_TS_DICT_H */
index f77fad4b3292ea49c719c55472292eb7c924b3ac..909644c96f2ecad0696312a54d2114756de6bd9f 100644 (file)
@@ -57,4 +57,7 @@ typedef FormData_pg_ts_parser *Form_pg_ts_parser;
 DECLARE_UNIQUE_INDEX(pg_ts_parser_prsname_index, 3606, TSParserNameNspIndexId, pg_ts_parser, btree(prsname name_ops, prsnamespace oid_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_ts_parser_oid_index, 3607, TSParserOidIndexId, pg_ts_parser, btree(oid oid_ops));
 
+MAKE_SYSCACHE(TSPARSERNAMENSP, pg_ts_parser_prsname_index, 2);
+MAKE_SYSCACHE(TSPARSEROID, pg_ts_parser_oid_index, 2);
+
 #endif                                                 /* PG_TS_PARSER_H */
index edb9fac5d01910c11c2d4bee041ac4449abe5a65..0562a4a7583b9846a095c4b0f6fb5fc6a54c5172 100644 (file)
@@ -48,4 +48,7 @@ typedef FormData_pg_ts_template *Form_pg_ts_template;
 DECLARE_UNIQUE_INDEX(pg_ts_template_tmplname_index, 3766, TSTemplateNameNspIndexId, pg_ts_template, btree(tmplname name_ops, tmplnamespace oid_ops));
 DECLARE_UNIQUE_INDEX_PKEY(pg_ts_template_oid_index, 3767, TSTemplateOidIndexId, pg_ts_template, btree(oid oid_ops));
 
+MAKE_SYSCACHE(TSTEMPLATENAMENSP, pg_ts_template_tmplname_index, 2);
+MAKE_SYSCACHE(TSTEMPLATEOID, pg_ts_template_oid_index, 2);
+
 #endif                                                 /* PG_TS_TEMPLATE_H */
index d28490e480662ac837d8ea735f09cf7b083cec91..e9259697321dae6519f38db1390561adf35eec5a 100644 (file)
@@ -265,6 +265,9 @@ DECLARE_TOAST(pg_type, 4171, 4172);
 DECLARE_UNIQUE_INDEX_PKEY(pg_type_oid_index, 2703, TypeOidIndexId, pg_type, btree(oid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_type_typname_nsp_index, 2704, TypeNameNspIndexId, pg_type, btree(typname name_ops, typnamespace oid_ops));
 
+MAKE_SYSCACHE(TYPEOID, pg_type_oid_index, 64);
+MAKE_SYSCACHE(TYPENAMENSP, pg_type_typname_nsp_index, 64);
+
 #ifdef EXPOSE_TO_CLIENT_CODE
 
 /*
index 7ad846edd281b19d98555741d5d35a5aae452486..3632448cce0b01ac0eeed379ff1970d76fbeeefa 100644 (file)
@@ -52,4 +52,7 @@ DECLARE_TOAST(pg_user_mapping, 4173, 4174);
 DECLARE_UNIQUE_INDEX_PKEY(pg_user_mapping_oid_index, 174, UserMappingOidIndexId, pg_user_mapping, btree(oid oid_ops));
 DECLARE_UNIQUE_INDEX(pg_user_mapping_user_server_index, 175, UserMappingUserServerIndexId, pg_user_mapping, btree(umuser oid_ops, umserver oid_ops));
 
+MAKE_SYSCACHE(USERMAPPINGOID, pg_user_mapping_oid_index, 2);
+MAKE_SYSCACHE(USERMAPPINGUSERSERVER, pg_user_mapping_user_server_index, 2);
+
 #endif                                                 /* PG_USER_MAPPING_H */
index 3fb3314b6ca395aeee5da8db98d50d9b1c213218..03a27dd0a83f4134e6638cdc42cf8c7014e1a38b 100644 (file)
 #include "access/htup.h"
 /* we intentionally do not include utils/catcache.h here */
 
-/*
- *             SysCache identifiers.
- *
- *             The order of these identifiers must match the order
- *             of the entries in the array cacheinfo[] in syscache.c.
- *             Keep them in alphabetical order (renumbering only costs a
- *             backend rebuild).
- */
-
-enum SysCacheIdentifier
-{
-       AGGFNOID = 0,
-       AMNAME,
-       AMOID,
-       AMOPOPID,
-       AMOPSTRATEGY,
-       AMPROCNUM,
-       ATTNAME,
-       ATTNUM,
-       AUTHMEMMEMROLE,
-       AUTHMEMROLEMEM,
-       AUTHNAME,
-       AUTHOID,
-       CASTSOURCETARGET,
-       CLAAMNAMENSP,
-       CLAOID,
-       COLLNAMEENCNSP,
-       COLLOID,
-       CONDEFAULT,
-       CONNAMENSP,
-       CONSTROID,
-       CONVOID,
-       DATABASEOID,
-       DEFACLROLENSPOBJ,
-       ENUMOID,
-       ENUMTYPOIDNAME,
-       EVENTTRIGGERNAME,
-       EVENTTRIGGEROID,
-       FOREIGNDATAWRAPPERNAME,
-       FOREIGNDATAWRAPPEROID,
-       FOREIGNSERVERNAME,
-       FOREIGNSERVEROID,
-       FOREIGNTABLEREL,
-       INDEXRELID,
-       LANGNAME,
-       LANGOID,
-       NAMESPACENAME,
-       NAMESPACEOID,
-       OPERNAMENSP,
-       OPEROID,
-       OPFAMILYAMNAMENSP,
-       OPFAMILYOID,
-       PARAMETERACLNAME,
-       PARAMETERACLOID,
-       PARTRELID,
-       PROCNAMEARGSNSP,
-       PROCOID,
-       PUBLICATIONNAME,
-       PUBLICATIONNAMESPACE,
-       PUBLICATIONNAMESPACEMAP,
-       PUBLICATIONOID,
-       PUBLICATIONREL,
-       PUBLICATIONRELMAP,
-       RANGEMULTIRANGE,
-       RANGETYPE,
-       RELNAMENSP,
-       RELOID,
-       REPLORIGIDENT,
-       REPLORIGNAME,
-       RULERELNAME,
-       SEQRELID,
-       STATEXTDATASTXOID,
-       STATEXTNAMENSP,
-       STATEXTOID,
-       STATRELATTINH,
-       SUBSCRIPTIONNAME,
-       SUBSCRIPTIONOID,
-       SUBSCRIPTIONRELMAP,
-       TABLESPACEOID,
-       TRFOID,
-       TRFTYPELANG,
-       TSCONFIGMAP,
-       TSCONFIGNAMENSP,
-       TSCONFIGOID,
-       TSDICTNAMENSP,
-       TSDICTOID,
-       TSPARSERNAMENSP,
-       TSPARSEROID,
-       TSTEMPLATENAMENSP,
-       TSTEMPLATEOID,
-       TYPENAMENSP,
-       TYPEOID,
-       USERMAPPINGOID,
-       USERMAPPINGUSERSERVER,
-
-#define SysCacheSize (USERMAPPINGUSERSERVER + 1)
-};
+#include "catalog/syscache_ids.h"
 
 extern void InitCatalogCache(void);
 extern void InitCatalogCachePhase2(void);
index 215473d22c92eff9216cef00a73de7008f306597..7edfc44b49aa9fdb30926cd2110567b9ec69ad7f 100755 (executable)
@@ -119,6 +119,11 @@ do
        test "$f" = src/include/common/unicode_nonspacing_table.h && continue
        test "$f" = src/include/common/unicode_east_asian_fw_table.h && continue
 
+       test "$f" = src/backend/catalog/syscache_ids.h && continue
+       test "$f" = src/backend/catalog/syscache_info.h && continue
+       test "$f" = src/include/catalog/syscache_ids.h && continue
+       test "$f" = src/include/catalog/syscache_info.h && continue
+
        # We can't make these Bison output files compilable standalone
        # without using "%code require", which old Bison versions lack.
        # parser/gram.h will be included by parser/gramparse.h anyway.
index a3eea5d3c87f7908dd08f753b786a2a5af42d7c3..84b892b5c514658756b4c22651d0fc79b6ec7dd6 100755 (executable)
@@ -114,6 +114,11 @@ do
        test "$f" = src/include/common/unicode_nonspacing_table.h && continue
        test "$f" = src/include/common/unicode_east_asian_fw_table.h && continue
 
+       test "$f" = src/backend/catalog/syscache_ids.h && continue
+       test "$f" = src/backend/catalog/syscache_info.h && continue
+       test "$f" = src/include/catalog/syscache_ids.h && continue
+       test "$f" = src/include/catalog/syscache_info.h && continue
+
        # We can't make these Bison output files compilable standalone
        # without using "%code require", which old Bison versions lack.
        # parser/gram.h will be included by parser/gramparse.h anyway.