Add primary keys and unique constraints to system catalogs
authorPeter Eisentraut <[email protected]>
Sat, 30 Jan 2021 18:14:31 +0000 (19:14 +0100)
committerPeter Eisentraut <[email protected]>
Sat, 30 Jan 2021 18:44:29 +0000 (19:44 +0100)
For those system catalogs that have a unique indexes, make a primary
key and unique constraint, using ALTER TABLE ... PRIMARY KEY/UNIQUE
USING INDEX.

This can be helpful for GUI tools that look for a primary key, and it
might in the future allow declaring foreign keys, for making schema
diagrams.

The constraint creation statements are automatically created by
genbki.pl from DECLARE_UNIQUE_INDEX directives.  To specify which one
of the available unique indexes is the primary key, use the new
directive DECLARE_UNIQUE_INDEX_PKEY instead.  By convention, we
usually make a catalog's OID column its primary key, if it has one.

Reviewed-by: Tom Lane <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/dc5f44d9-5ec1-a596-0251-dadadcdede98@2ndquadrant.com

71 files changed:
src/backend/catalog/.gitignore
src/backend/catalog/Catalog.pm
src/backend/catalog/Makefile
src/backend/catalog/genbki.pl
src/bin/initdb/initdb.c
src/include/catalog/genbki.h
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_attrdef.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_db_role_setting.h
src/include/catalog/pg_default_acl.h
src/include/catalog/pg_description.h
src/include/catalog/pg_enum.h
src/include/catalog/pg_event_trigger.h
src/include/catalog/pg_extension.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_inherits.h
src/include/catalog/pg_init_privs.h
src/include/catalog/pg_language.h
src/include/catalog/pg_largeobject.h
src/include/catalog/pg_largeobject_metadata.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_partitioned_table.h
src/include/catalog/pg_policy.h
src/include/catalog/pg_proc.h
src/include/catalog/pg_publication.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_seclabel.h
src/include/catalog/pg_sequence.h
src/include/catalog/pg_shdescription.h
src/include/catalog/pg_shseclabel.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_trigger.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/test/modules/unsafe_tests/expected/alter_system_table.out
src/test/modules/unsafe_tests/sql/alter_system_table.sql
src/test/regress/expected/misc_sanity.out
src/test/regress/sql/misc_sanity.sql
src/tools/msvc/clean.bat

index 11e2e5202326b9d55207860b30a7c3a84e042af7..4bd3ee9d7f39171a0256a9daeea621e0e08a829c 100644 (file)
@@ -1,4 +1,5 @@
 /postgres.bki
 /schemapg.h
+/system_constraints.sql
 /pg_*_d.h
 /bki-stamp
index a37c3271229ce57ac6ef201ae4c8ffdd69ed06f9..061f3d8c21ebd6a0a2200caf13cb63381eb24865 100644 (file)
@@ -94,14 +94,15 @@ sub ParseHeader
            push @{ $catalog{toasting} },
              { parent_table => $1, toast_oid => $2, toast_index_oid => $3 };
        }
-       elsif (/^DECLARE_(UNIQUE_)?INDEX\(\s*(\w+),\s*(\d+),\s*(.+)\)/)
+       elsif (/^DECLARE_(UNIQUE_)?INDEX(_PKEY)?\(\s*(\w+),\s*(\d+),\s*(.+)\)/)
        {
            push @{ $catalog{indexing} },
-             {
+           {
                is_unique => $1 ? 1 : 0,
-               index_name => $2,
-               index_oid  => $3,
-               index_decl => $4
+               is_pkey => $2 ? 1 : 0,
+               index_name => $3,
+               index_oid  => $4,
+               index_decl => $5
              };
        }
        elsif (/^CATALOG\((\w+),(\d+),(\w+)\)/)
index c85f0ca7b66de3e43f76bcd8889951a498552952..995ddf128523f30a57de62b27ffdf0112352ff93 100644 (file)
@@ -121,6 +121,7 @@ $(top_builddir)/src/include/catalog/header-stamp: bki-stamp
 .PHONY: install-data
 install-data: bki-stamp installdirs
    $(INSTALL_DATA) $(call vpathsearch,postgres.bki) '$(DESTDIR)$(datadir)/postgres.bki'
+   $(INSTALL_DATA) $(call vpathsearch,system_constraints.sql) '$(DESTDIR)$(datadir)/system_constraints.sql'
    $(INSTALL_DATA) $(srcdir)/system_views.sql '$(DESTDIR)$(datadir)/system_views.sql'
    $(INSTALL_DATA) $(srcdir)/information_schema.sql '$(DESTDIR)$(datadir)/information_schema.sql'
    $(INSTALL_DATA) $(srcdir)/sql_features.txt '$(DESTDIR)$(datadir)/sql_features.txt'
@@ -130,11 +131,11 @@ installdirs:
 
 .PHONY: uninstall-data
 uninstall-data:
-   rm -f $(addprefix '$(DESTDIR)$(datadir)'/, postgres.bki system_views.sql information_schema.sql sql_features.txt)
+   rm -f $(addprefix '$(DESTDIR)$(datadir)'/, postgres.bki system_constraints.sql system_views.sql information_schema.sql sql_features.txt)
 
-# postgres.bki and the generated headers are in the distribution tarball,
-# so they are not cleaned here.
+# postgres.bki, system_constraints.sql, and the generated headers are
+# in the distribution tarball, so they are not cleaned here.
 clean:
 
 maintainer-clean: clean
-   rm -f bki-stamp postgres.bki $(GENERATED_HEADERS)
+   rm -f bki-stamp postgres.bki system_constraints.sql $(GENERATED_HEADERS)
index 009e215da1c0b79a36c2acaf94ea7f25ff2ae49a..b68c1752c0098cae09e5a767a95cdc65b13a5041 100644 (file)
@@ -55,6 +55,7 @@ my %catalog_data;
 my @toast_decls;
 my @index_decls;
 my %oidcounts;
+my @system_constraints;
 
 foreach my $header (@ARGV)
 {
@@ -137,6 +138,17 @@ foreach my $header (@ARGV)
          $index->{index_name}, $index->{index_oid},
          $index->{index_decl};
        $oidcounts{ $index->{index_oid} }++;
+
+       if ($index->{is_unique})
+       {
+           $index->{index_decl} =~ /on (\w+) using/;
+           my $tblname = $1;
+           push @system_constraints,
+             sprintf "ALTER TABLE %s ADD %s USING INDEX %s;",
+             $tblname,
+             $index->{is_pkey} ? "PRIMARY KEY" : "UNIQUE",
+             $index->{index_name};
+       }
    }
 }
 
@@ -388,6 +400,9 @@ open my $bki, '>', $bkifile . $tmpext
 my $schemafile = $output_path . 'schemapg.h';
 open my $schemapg, '>', $schemafile . $tmpext
   or die "can't open $schemafile$tmpext: $!";
+my $constraints_file = $output_path . 'system_constraints.sql';
+open my $constraints, '>', $constraints_file . $tmpext
+  or die "can't open $constraints_file$tmpext: $!";
 
 # Generate postgres.bki and pg_*_d.h headers.
 
@@ -648,6 +663,12 @@ die
   "genbki OID counter reached $GenbkiNextOid, overrunning FirstBootstrapObjectId\n"
   if $GenbkiNextOid > $FirstBootstrapObjectId;
 
+# Now generate system_constraints.sql
+
+foreach my $c (@system_constraints)
+{
+   print $constraints $c, "\n";
+}
 
 # Now generate schemapg.h
 
@@ -688,10 +709,12 @@ print $schemapg "\n#endif\t\t\t\t\t\t\t/* SCHEMAPG_H */\n";
 # We're done emitting data
 close $bki;
 close $schemapg;
+close $constraints;
 
 # Finally, rename the completed files into place.
 Catalog::RenameTempFile($bkifile,    $tmpext);
 Catalog::RenameTempFile($schemafile, $tmpext);
+Catalog::RenameTempFile($constraints_file, $tmpext);
 
 exit 0;
 
index e242a4a5b586a4a54869cd719fc5dfb221f1e0a4..62540a1b37d5e79740435d1374eb77b4cb619407 100644 (file)
@@ -159,6 +159,7 @@ static char *conf_file;
 static char *dictionary_file;
 static char *info_schema_file;
 static char *features_file;
+static char *system_constraints_file;
 static char *system_views_file;
 static bool success = false;
 static bool made_new_pgdata = false;
@@ -251,10 +252,9 @@ static void bootstrap_template1(void);
 static void setup_auth(FILE *cmdfd);
 static void get_su_pwd(void);
 static void setup_depend(FILE *cmdfd);
-static void setup_sysviews(FILE *cmdfd);
+static void setup_run_file(FILE *cmdfd, const char *filename);
 static void setup_description(FILE *cmdfd);
 static void setup_collation(FILE *cmdfd);
-static void setup_dictionary(FILE *cmdfd);
 static void setup_privileges(FILE *cmdfd);
 static void set_info_version(void);
 static void setup_schema(FILE *cmdfd);
@@ -1600,17 +1600,16 @@ setup_depend(FILE *cmdfd)
 }
 
 /*
- * set up system views
+ * Run external file
  */
 static void
-setup_sysviews(FILE *cmdfd)
+setup_run_file(FILE *cmdfd, const char *filename)
 {
-   char      **line;
-   char      **sysviews_setup;
+   char      **lines;
 
-   sysviews_setup = readfile(system_views_file);
+   lines = readfile(filename);
 
-   for (line = sysviews_setup; *line != NULL; line++)
+   for (char **line = lines; *line != NULL; line++)
    {
        PG_CMD_PUTS(*line);
        free(*line);
@@ -1618,7 +1617,7 @@ setup_sysviews(FILE *cmdfd)
 
    PG_CMD_PUTS("\n\n");
 
-   free(sysviews_setup);
+   free(lines);
 }
 
 /*
@@ -1661,27 +1660,6 @@ setup_collation(FILE *cmdfd)
    PG_CMD_PUTS("SELECT pg_import_system_collations('pg_catalog');\n\n");
 }
 
-/*
- * load extra dictionaries (Snowball stemmers)
- */
-static void
-setup_dictionary(FILE *cmdfd)
-{
-   char      **line;
-   char      **conv_lines;
-
-   conv_lines = readfile(dictionary_file);
-   for (line = conv_lines; *line != NULL; line++)
-   {
-       PG_CMD_PUTS(*line);
-       free(*line);
-   }
-
-   PG_CMD_PUTS("\n\n");
-
-   free(conv_lines);
-}
-
 /*
  * Set up privileges
  *
@@ -1882,20 +1860,7 @@ set_info_version(void)
 static void
 setup_schema(FILE *cmdfd)
 {
-   char      **line;
-   char      **lines;
-
-   lines = readfile(info_schema_file);
-
-   for (line = lines; *line != NULL; line++)
-   {
-       PG_CMD_PUTS(*line);
-       free(*line);
-   }
-
-   PG_CMD_PUTS("\n\n");
-
-   free(lines);
+   setup_run_file(cmdfd, info_schema_file);
 
    PG_CMD_PRINTF("UPDATE information_schema.sql_implementation_info "
                  "  SET character_value = '%s' "
@@ -2534,6 +2499,7 @@ setup_data_file_paths(void)
    set_input(&dictionary_file, "snowball_create.sql");
    set_input(&info_schema_file, "information_schema.sql");
    set_input(&features_file, "sql_features.txt");
+   set_input(&system_constraints_file, "system_constraints.sql");
    set_input(&system_views_file, "system_views.sql");
 
    if (show_setting || debug)
@@ -2895,6 +2861,8 @@ initialize_data_directory(void)
 
    setup_auth(cmdfd);
 
+   setup_run_file(cmdfd, system_constraints_file);
+
    setup_depend(cmdfd);
 
    /*
@@ -2902,13 +2870,13 @@ initialize_data_directory(void)
     * They are all droppable at the whim of the DBA.
     */
 
-   setup_sysviews(cmdfd);
+   setup_run_file(cmdfd, system_views_file);
 
    setup_description(cmdfd);
 
    setup_collation(cmdfd);
 
-   setup_dictionary(cmdfd);
+   setup_run_file(cmdfd, dictionary_file);
 
    setup_privileges(cmdfd);
 
index e26bde6d09b2ca4d07a268a1b84a57bd527e3773..5d05fafb5dae9a4a4ec6be5fd605964283306ff1 100644 (file)
 #define DECLARE_TOAST(name,toastoid,indexoid) extern int no_such_variable
 
 /*
- * These lines processed by genbki.pl to create the statements
+ * These lines are processed by genbki.pl to create the statements
  * the bootstrap parser will turn into DefineIndex calls.
  *
- * The keyword is DECLARE_INDEX or DECLARE_UNIQUE_INDEX.  The first two
- * arguments are the index name and OID, the rest is much like a standard
- * 'create index' SQL command.
+ * The keyword is DECLARE_INDEX or DECLARE_UNIQUE_INDEX or
+ * DECLARE_UNIQUE_INDEX_PKEY.  ("PKEY" marks the index as being the catalog's
+ * primary key; currently this is only cosmetically different from a regular
+ * unique index.  By convention, we usually make a catalog's OID column its
+ * pkey, if it has one.)  The first two arguments are the index's name and
+ * OID, the rest is much like a standard 'create index' SQL command.
  *
  * For each index, we also provide a #define for its OID.  References to
  * the index in the C code should always use these #defines, not the actual
@@ -70,6 +73,7 @@
  */
 #define DECLARE_INDEX(name,oid,decl) extern int no_such_variable
 #define DECLARE_UNIQUE_INDEX(name,oid,decl) extern int no_such_variable
+#define DECLARE_UNIQUE_INDEX_PKEY(name,oid,decl) extern int no_such_variable
 
 /* The following are never defined; they are here only for documentation. */
 
index e90c3f847e1ff22dd8c370aa596f8ccee2629faf..8b03cdeea2429d10421041b28e1be626b8194967 100644 (file)
@@ -110,7 +110,7 @@ typedef FormData_pg_aggregate *Form_pg_aggregate;
 
 DECLARE_TOAST(pg_aggregate, 4159, 4160);
 
-DECLARE_UNIQUE_INDEX(pg_aggregate_fnoid_index, 2650, on pg_aggregate using btree(aggfnoid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_aggregate_fnoid_index, 2650, on pg_aggregate using btree(aggfnoid oid_ops));
 #define AggregateFnoidIndexId  2650
 
 #ifdef EXPOSE_TO_CLIENT_CODE
index 358f5aac8fc42bf0bddb7ddd5711febad85152ed..ced86faef84947050b0aeeeac9342d018b2105d6 100644 (file)
@@ -49,7 +49,7 @@ typedef FormData_pg_am *Form_pg_am;
 
 DECLARE_UNIQUE_INDEX(pg_am_name_index, 2651, on pg_am using btree(amname name_ops));
 #define AmNameIndexId  2651
-DECLARE_UNIQUE_INDEX(pg_am_oid_index, 2652, on pg_am using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_am_oid_index, 2652, on pg_am using btree(oid oid_ops));
 #define AmOidIndexId  2652
 
 #ifdef EXPOSE_TO_CLIENT_CODE
index 3ccd75f67b58748af8aa1380e08abd8dff4ee556..554fc41497d62fcfd0ba76f54fe34ca85a53e503 100644 (file)
@@ -91,7 +91,7 @@ DECLARE_UNIQUE_INDEX(pg_amop_fam_strat_index, 2653, on pg_amop using btree(amopf
 #define AccessMethodStrategyIndexId  2653
 DECLARE_UNIQUE_INDEX(pg_amop_opr_fam_index, 2654, on pg_amop using btree(amopopr oid_ops, amoppurpose char_ops, amopfamily oid_ops));
 #define AccessMethodOperatorIndexId  2654
-DECLARE_UNIQUE_INDEX(pg_amop_oid_index, 2756, on pg_amop using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_amop_oid_index, 2756, on pg_amop using btree(oid oid_ops));
 #define AccessMethodOperatorOidIndexId 2756
 
 #ifdef EXPOSE_TO_CLIENT_CODE
index 86f1f25d17f9041f48febe50f1c1d050ade4d0d9..8a727c359a4e775528b46fe056353927da7ac7ab 100644 (file)
@@ -69,7 +69,7 @@ typedef FormData_pg_amproc *Form_pg_amproc;
 
 DECLARE_UNIQUE_INDEX(pg_amproc_fam_proc_index, 2655, on pg_amproc using btree(amprocfamily oid_ops, amproclefttype oid_ops, amprocrighttype oid_ops, amprocnum int2_ops));
 #define AccessMethodProcedureIndexId  2655
-DECLARE_UNIQUE_INDEX(pg_amproc_oid_index, 2757, on pg_amproc using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_amproc_oid_index, 2757, on pg_amproc using btree(oid oid_ops));
 #define AccessMethodProcedureOidIndexId  2757
 
 #endif                         /* PG_AMPROC_H */
index fe3aa289927f85ec273535cfbf60c95999c84278..03efaaded9cc1ce945c43bab4dbd355faec7cc67 100644 (file)
@@ -50,7 +50,7 @@ DECLARE_TOAST(pg_attrdef, 2830, 2831);
 
 DECLARE_UNIQUE_INDEX(pg_attrdef_adrelid_adnum_index, 2656, on pg_attrdef using btree(adrelid oid_ops, adnum int2_ops));
 #define AttrDefaultIndexId 2656
-DECLARE_UNIQUE_INDEX(pg_attrdef_oid_index, 2657, on pg_attrdef using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_attrdef_oid_index, 2657, on pg_attrdef using btree(oid oid_ops));
 #define AttrDefaultOidIndexId  2657
 
 #endif                         /* PG_ATTRDEF_H */
index 059dec3647dadc177535883409356fc0d05d0d86..ba0efff08c02b26ce7ca71adadf4988ebed735dd 100644 (file)
@@ -194,7 +194,7 @@ typedef FormData_pg_attribute *Form_pg_attribute;
 
 DECLARE_UNIQUE_INDEX(pg_attribute_relid_attnam_index, 2658, on pg_attribute using btree(attrelid oid_ops, attname name_ops));
 #define AttributeRelidNameIndexId  2658
-DECLARE_UNIQUE_INDEX(pg_attribute_relid_attnum_index, 2659, on pg_attribute using btree(attrelid oid_ops, attnum int2_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_attribute_relid_attnum_index, 2659, on pg_attribute using btree(attrelid oid_ops, attnum int2_ops));
 #define AttributeRelidNumIndexId  2659
 
 #ifdef EXPOSE_TO_CLIENT_CODE
index fc5a2dced7b5d3201c483eba45c2e9d4a1773224..e90c39564088ff5fdb25aca6bb3616c4553b9c65 100644 (file)
@@ -42,7 +42,7 @@ CATALOG(pg_auth_members,1261,AuthMemRelationId) BKI_SHARED_RELATION BKI_ROWTYPE_
  */
 typedef FormData_pg_auth_members *Form_pg_auth_members;
 
-DECLARE_UNIQUE_INDEX(pg_auth_members_role_member_index, 2694, on pg_auth_members using btree(roleid oid_ops, member oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_auth_members_role_member_index, 2694, on pg_auth_members using btree(roleid oid_ops, member oid_ops));
 #define AuthMemRoleMemIndexId  2694
 DECLARE_UNIQUE_INDEX(pg_auth_members_member_role_index, 2695, on pg_auth_members using btree(member oid_ops, roleid oid_ops));
 #define AuthMemMemRoleIndexId  2695
index 4063072cc915cf7beb3c9ca498245a303e01b52a..1a5c7a73c7c67fefe6cd10276bf637b6776bbc1b 100644 (file)
@@ -61,7 +61,7 @@ DECLARE_TOAST(pg_authid, 4175, 4176);
 
 DECLARE_UNIQUE_INDEX(pg_authid_rolname_index, 2676, on pg_authid using btree(rolname name_ops));
 #define AuthIdRolnameIndexId   2676
-DECLARE_UNIQUE_INDEX(pg_authid_oid_index, 2677, on pg_authid using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_authid_oid_index, 2677, on pg_authid using btree(oid oid_ops));
 #define AuthIdOidIndexId   2677
 
 #endif                         /* PG_AUTHID_H */
index 03ad900a49900c7b9948b6212faf59ce20dbd6cc..2d36628c2011dc811bc9645bfedf624bf7d30a07 100644 (file)
@@ -56,7 +56,7 @@ CATALOG(pg_cast,2605,CastRelationId)
  */
 typedef FormData_pg_cast *Form_pg_cast;
 
-DECLARE_UNIQUE_INDEX(pg_cast_oid_index, 2660, on pg_cast using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_cast_oid_index, 2660, on pg_cast using btree(oid oid_ops));
 #define CastOidIndexId 2660
 DECLARE_UNIQUE_INDEX(pg_cast_source_target_index, 2661, on pg_cast using btree(castsource oid_ops, casttarget oid_ops));
 #define CastSourceTargetIndexId  2661
index e8dcd15a55fbd32254676a0bdb8212956d3b7d75..eca306ca98f5d1b6c3467a1d3df1ac68b3d0a3a3 100644 (file)
@@ -152,7 +152,7 @@ CATALOG(pg_class,1259,RelationRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83,Relat
  */
 typedef FormData_pg_class *Form_pg_class;
 
-DECLARE_UNIQUE_INDEX(pg_class_oid_index, 2662, on pg_class using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_class_oid_index, 2662, on pg_class using btree(oid oid_ops));
 #define ClassOidIndexId  2662
 DECLARE_UNIQUE_INDEX(pg_class_relname_nsp_index, 2663, on pg_class using btree(relname name_ops, relnamespace oid_ops));
 #define ClassNameNspIndexId  2663
index 251c2b9adae867f199f4b0a3d43d37a1b4c9b041..3c496ea914184c5345e8570ced3204ebea50b456 100644 (file)
@@ -48,7 +48,7 @@ typedef FormData_pg_collation *Form_pg_collation;
 
 DECLARE_UNIQUE_INDEX(pg_collation_name_enc_nsp_index, 3164, on pg_collation using btree(collname name_ops, collencoding int4_ops, collnamespace oid_ops));
 #define CollationNameEncNspIndexId 3164
-DECLARE_UNIQUE_INDEX(pg_collation_oid_index, 3085, on pg_collation using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_collation_oid_index, 3085, on pg_collation using btree(oid oid_ops));
 #define CollationOidIndexId  3085
 
 #ifdef EXPOSE_TO_CLIENT_CODE
index f3c3df390fee9dee32271e0f3ee3ca9967251dbf..6449937b352db4ff0c60d5f35bb00d1ca0169e07 100644 (file)
@@ -161,7 +161,7 @@ DECLARE_UNIQUE_INDEX(pg_constraint_conrelid_contypid_conname_index, 2665, on pg_
 #define ConstraintRelidTypidNameIndexId    2665
 DECLARE_INDEX(pg_constraint_contypid_index, 2666, on pg_constraint using btree(contypid oid_ops));
 #define ConstraintTypidIndexId 2666
-DECLARE_UNIQUE_INDEX(pg_constraint_oid_index, 2667, on pg_constraint using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_constraint_oid_index, 2667, on pg_constraint using btree(oid oid_ops));
 #define ConstraintOidIndexId  2667
 DECLARE_INDEX(pg_constraint_conparentid_index, 2579, on pg_constraint using btree(conparentid oid_ops));
 #define ConstraintParentIndexId    2579
index 93dcc35840ce6577cf272c570ab547f39a14cc69..b02dfe0c3f776d426b7a7845e3bcbf81b614afc7 100644 (file)
@@ -64,7 +64,7 @@ DECLARE_UNIQUE_INDEX(pg_conversion_default_index, 2668, on pg_conversion using b
 #define ConversionDefaultIndexId  2668
 DECLARE_UNIQUE_INDEX(pg_conversion_name_nsp_index, 2669, on pg_conversion using btree(conname name_ops, connamespace oid_ops));
 #define ConversionNameNspIndexId  2669
-DECLARE_UNIQUE_INDEX(pg_conversion_oid_index, 2670, on pg_conversion using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_conversion_oid_index, 2670, on pg_conversion using btree(oid oid_ops));
 #define ConversionOidIndexId  2670
 
 
index 97691127bf539d366b4d400558d129adcd6f50d8..b7a0b6a381b4c08304b52d8177b3f62820531aac 100644 (file)
@@ -86,7 +86,7 @@ DECLARE_TOAST(pg_database, 4177, 4178);
 
 DECLARE_UNIQUE_INDEX(pg_database_datname_index, 2671, on pg_database using btree(datname name_ops));
 #define DatabaseNameIndexId  2671
-DECLARE_UNIQUE_INDEX(pg_database_oid_index, 2672, on pg_database using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_database_oid_index, 2672, on pg_database using btree(oid oid_ops));
 #define DatabaseOidIndexId 2672
 
 #endif                         /* PG_DATABASE_H */
index d3c006d7544d884c0f159353f794f146b0e140cc..f18819d670c459e9b30f45ae129ceed8b8190bbc 100644 (file)
@@ -47,7 +47,7 @@ DECLARE_TOAST(pg_db_role_setting, 2966, 2967);
 #define PgDbRoleSettingToastTable 2966
 #define PgDbRoleSettingToastIndex 2967
 
-DECLARE_UNIQUE_INDEX(pg_db_role_setting_databaseid_rol_index, 2965, on pg_db_role_setting using btree(setdatabase oid_ops, setrole oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_db_role_setting_databaseid_rol_index, 2965, on pg_db_role_setting using btree(setdatabase oid_ops, setrole oid_ops));
 #define DbRoleSettingDatidRolidIndexId 2965
 
 /*
index 0f3974c32cbe33976fa138f8758f1e03c161d702..bb7db32cd6c395f92518f4037dcf53fd88d2a0d7 100644 (file)
@@ -51,7 +51,7 @@ DECLARE_TOAST(pg_default_acl, 4143, 4144);
 
 DECLARE_UNIQUE_INDEX(pg_default_acl_role_nsp_obj_index, 827, on pg_default_acl using btree(defaclrole oid_ops, defaclnamespace oid_ops, defaclobjtype char_ops));
 #define DefaultAclRoleNspObjIndexId 827
-DECLARE_UNIQUE_INDEX(pg_default_acl_oid_index, 828, on pg_default_acl using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_default_acl_oid_index, 828, on pg_default_acl using btree(oid oid_ops));
 #define DefaultAclOidIndexId   828
 
 #ifdef EXPOSE_TO_CLIENT_CODE
index 0002643a76c2125dc5a580b9587c6fbc0be45de0..ad9de5e0a06239ba2d96c9a3463eb852649928c3 100644 (file)
@@ -65,7 +65,7 @@ typedef FormData_pg_description * Form_pg_description;
 
 DECLARE_TOAST(pg_description, 2834, 2835);
 
-DECLARE_UNIQUE_INDEX(pg_description_o_c_o_index, 2675, on pg_description using btree(objoid oid_ops, classoid oid_ops, objsubid int4_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_description_o_c_o_index, 2675, on pg_description using btree(objoid oid_ops, classoid oid_ops, objsubid int4_ops));
 #define DescriptionObjIndexId  2675
 
 #endif                         /* PG_DESCRIPTION_H */
index 3ae7a03d4e1d731cd3ef3f70a4e1cd9e990700b6..5eaf70772c71441a9d9d585d3d70f61bca59a601 100644 (file)
@@ -43,7 +43,7 @@ CATALOG(pg_enum,3501,EnumRelationId)
  */
 typedef FormData_pg_enum *Form_pg_enum;
 
-DECLARE_UNIQUE_INDEX(pg_enum_oid_index, 3502, on pg_enum using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_enum_oid_index, 3502, on pg_enum using btree(oid oid_ops));
 #define EnumOidIndexId 3502
 DECLARE_UNIQUE_INDEX(pg_enum_typid_label_index, 3503, on pg_enum using btree(enumtypid oid_ops, enumlabel name_ops));
 #define EnumTypIdLabelIndexId 3503
index 4011654969c0b3af2530b631aa07ce932218fd6d..6f0266ed0fae2e7be3e152d9c241aa38eadf8e61 100644 (file)
@@ -52,7 +52,7 @@ DECLARE_TOAST(pg_event_trigger, 4145, 4146);
 
 DECLARE_UNIQUE_INDEX(pg_event_trigger_evtname_index, 3467, on pg_event_trigger using btree(evtname name_ops));
 #define EventTriggerNameIndexId  3467
-DECLARE_UNIQUE_INDEX(pg_event_trigger_oid_index, 3468, on pg_event_trigger using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_event_trigger_oid_index, 3468, on pg_event_trigger using btree(oid oid_ops));
 #define EventTriggerOidIndexId 3468
 
 #endif                         /* PG_EVENT_TRIGGER_H */
index f7d640fac6fbb43acf8486f31dcaf8bfaaee4555..af119bfea7a8cb0fcb3c387a27b45be82538d6f2 100644 (file)
@@ -51,7 +51,7 @@ typedef FormData_pg_extension *Form_pg_extension;
 
 DECLARE_TOAST(pg_extension, 4147, 4148);
 
-DECLARE_UNIQUE_INDEX(pg_extension_oid_index, 3080, on pg_extension using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_extension_oid_index, 3080, on pg_extension using btree(oid oid_ops));
 #define ExtensionOidIndexId 3080
 DECLARE_UNIQUE_INDEX(pg_extension_name_index, 3081, on pg_extension using btree(extname name_ops));
 #define ExtensionNameIndexId 3081
index ca73dc280cabd80b8d3388769ba0137096e79485..0f523a26b9c4ff96566abb5a92cda876767d503f 100644 (file)
@@ -49,7 +49,7 @@ typedef FormData_pg_foreign_data_wrapper *Form_pg_foreign_data_wrapper;
 
 DECLARE_TOAST(pg_foreign_data_wrapper, 4149, 4150);
 
-DECLARE_UNIQUE_INDEX(pg_foreign_data_wrapper_oid_index, 112, on pg_foreign_data_wrapper using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_foreign_data_wrapper_oid_index, 112, on pg_foreign_data_wrapper using btree(oid oid_ops));
 #define ForeignDataWrapperOidIndexId   112
 DECLARE_UNIQUE_INDEX(pg_foreign_data_wrapper_name_index, 548, on pg_foreign_data_wrapper using btree(fdwname name_ops));
 #define ForeignDataWrapperNameIndexId  548
index 3a68f444e706bb21b3197825f3c19486b71b7ea8..385b896e970d582b3b256c3053b98c5a9522bea2 100644 (file)
@@ -49,7 +49,7 @@ typedef FormData_pg_foreign_server *Form_pg_foreign_server;
 
 DECLARE_TOAST(pg_foreign_server, 4151, 4152);
 
-DECLARE_UNIQUE_INDEX(pg_foreign_server_oid_index, 113, on pg_foreign_server using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_foreign_server_oid_index, 113, on pg_foreign_server using btree(oid oid_ops));
 #define ForeignServerOidIndexId 113
 DECLARE_UNIQUE_INDEX(pg_foreign_server_name_index, 549, on pg_foreign_server using btree(srvname name_ops));
 #define ForeignServerNameIndexId   549
index c761852bb938ae7917f4f83ea2823705ddec560f..24f7f2998eb80d84ab0f72bce45b854d34dc7436 100644 (file)
@@ -44,7 +44,7 @@ typedef FormData_pg_foreign_table *Form_pg_foreign_table;
 
 DECLARE_TOAST(pg_foreign_table, 4153, 4154);
 
-DECLARE_UNIQUE_INDEX(pg_foreign_table_relid_index, 3119, on pg_foreign_table using btree(ftrelid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_foreign_table_relid_index, 3119, on pg_foreign_table using btree(ftrelid oid_ops));
 #define ForeignTableRelidIndexId 3119
 
 #endif                         /* PG_FOREIGN_TABLE_H */
index b6d7ebec559606903f9404e9a1b5576ae4567d3e..1a7aef18ce85f5ac1c790bf7c0391ddc16e9517c 100644 (file)
@@ -69,7 +69,7 @@ typedef FormData_pg_index *Form_pg_index;
 
 DECLARE_INDEX(pg_index_indrelid_index, 2678, on pg_index using btree(indrelid oid_ops));
 #define IndexIndrelidIndexId  2678
-DECLARE_UNIQUE_INDEX(pg_index_indexrelid_index, 2679, on pg_index using btree(indexrelid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_index_indexrelid_index, 2679, on pg_index using btree(indexrelid oid_ops));
 #define IndexRelidIndexId  2679
 
 #ifdef EXPOSE_TO_CLIENT_CODE
index a0f2ec4e0bd303ced40260c2bf7d6193653e9979..b8147796d855f0f9548692b3cdfe7e1890903eef 100644 (file)
@@ -43,7 +43,7 @@ CATALOG(pg_inherits,2611,InheritsRelationId)
  */
 typedef FormData_pg_inherits *Form_pg_inherits;
 
-DECLARE_UNIQUE_INDEX(pg_inherits_relid_seqno_index, 2680, on pg_inherits using btree(inhrelid oid_ops, inhseqno int4_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_inherits_relid_seqno_index, 2680, on pg_inherits using btree(inhrelid oid_ops, inhseqno int4_ops));
 #define InheritsRelidSeqnoIndexId  2680
 DECLARE_INDEX(pg_inherits_parent_index, 2187, on pg_inherits using btree(inhparent oid_ops));
 #define InheritsParentIndexId  2187
index da1fa5b279afecf5d8e8077a54259a1c60a4df53..983b1857c0c7d9a22d5149ec0b880d9d1e9feb56 100644 (file)
@@ -64,7 +64,7 @@ typedef FormData_pg_init_privs * Form_pg_init_privs;
 
 DECLARE_TOAST(pg_init_privs, 4155, 4156);
 
-DECLARE_UNIQUE_INDEX(pg_init_privs_o_c_o_index, 3395, on pg_init_privs using btree(objoid oid_ops, classoid oid_ops, objsubid int4_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_init_privs_o_c_o_index, 3395, on pg_init_privs using btree(objoid oid_ops, classoid oid_ops, objsubid int4_ops));
 #define InitPrivsObjIndexId  3395
 
 /*
index ffab93eb6a33f41d261862fdeb5937fc7b2f6bfc..b1dcd0a4f579dc92055901ce669381dca6131a7c 100644 (file)
@@ -68,7 +68,7 @@ DECLARE_TOAST(pg_language, 4157, 4158);
 
 DECLARE_UNIQUE_INDEX(pg_language_name_index, 2681, on pg_language using btree(lanname name_ops));
 #define LanguageNameIndexId  2681
-DECLARE_UNIQUE_INDEX(pg_language_oid_index, 2682, on pg_language using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_language_oid_index, 2682, on pg_language using btree(oid oid_ops));
 #define LanguageOidIndexId 2682
 
 #endif                         /* PG_LANGUAGE_H */
index 80b1cbae8310602a54c7d9e7d9e277e13bb64e82..f453319322aa760f7183ae807b9952754a97c109 100644 (file)
@@ -43,7 +43,7 @@ CATALOG(pg_largeobject,2613,LargeObjectRelationId)
  */
 typedef FormData_pg_largeobject *Form_pg_largeobject;
 
-DECLARE_UNIQUE_INDEX(pg_largeobject_loid_pn_index, 2683, on pg_largeobject using btree(loid oid_ops, pageno int4_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_largeobject_loid_pn_index, 2683, on pg_largeobject using btree(loid oid_ops, pageno int4_ops));
 #define LargeObjectLOidPNIndexId  2683
 
 extern Oid LargeObjectCreate(Oid loid);
index b1504a22fa34b5b9fb3f0ae617d7b0bec46a0a61..220988b0ad600ec7a34251dc39d8aca32705b824 100644 (file)
@@ -45,7 +45,7 @@ CATALOG(pg_largeobject_metadata,2995,LargeObjectMetadataRelationId)
  */
 typedef FormData_pg_largeobject_metadata *Form_pg_largeobject_metadata;
 
-DECLARE_UNIQUE_INDEX(pg_largeobject_metadata_oid_index, 2996, on pg_largeobject_metadata using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_largeobject_metadata_oid_index, 2996, on pg_largeobject_metadata using btree(oid oid_ops));
 #define LargeObjectMetadataOidIndexId  2996
 
 #endif                         /* PG_LARGEOBJECT_METADATA_H */
index 5710c37d78c817b5fe95bc0b354ffe91409ea1d0..0a68958b1c4c90e613abb0ea711e61115fdbe04d 100644 (file)
@@ -55,7 +55,7 @@ DECLARE_TOAST(pg_namespace, 4163, 4164);
 
 DECLARE_UNIQUE_INDEX(pg_namespace_nspname_index, 2684, on pg_namespace using btree(nspname name_ops));
 #define NamespaceNameIndexId  2684
-DECLARE_UNIQUE_INDEX(pg_namespace_oid_index, 2685, on pg_namespace using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_namespace_oid_index, 2685, on pg_namespace using btree(oid oid_ops));
 #define NamespaceOidIndexId  2685
 
 /*
index 7836d56c3f35afdfc7a1eb1cfaa0361e63bb2ecb..d132df1f2f7ee718f5ee73aee6adf64648d6f7b5 100644 (file)
@@ -84,7 +84,7 @@ typedef FormData_pg_opclass *Form_pg_opclass;
 
 DECLARE_UNIQUE_INDEX(pg_opclass_am_name_nsp_index, 2686, on pg_opclass using btree(opcmethod oid_ops, opcname name_ops, opcnamespace oid_ops));
 #define OpclassAmNameNspIndexId  2686
-DECLARE_UNIQUE_INDEX(pg_opclass_oid_index, 2687, on pg_opclass using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_opclass_oid_index, 2687, on pg_opclass using btree(oid oid_ops));
 #define OpclassOidIndexId  2687
 
 #endif                         /* PG_OPCLASS_H */
index 05a3fe1815756b7e1e2b3452ac51b9e1291ac050..3ca57e7c1b4b17c4753f93c5867e00bef4fbc282 100644 (file)
@@ -82,7 +82,7 @@ CATALOG(pg_operator,2617,OperatorRelationId)
  */
 typedef FormData_pg_operator *Form_pg_operator;
 
-DECLARE_UNIQUE_INDEX(pg_operator_oid_index, 2688, on pg_operator using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_operator_oid_index, 2688, on pg_operator using btree(oid oid_ops));
 #define OperatorOidIndexId 2688
 DECLARE_UNIQUE_INDEX(pg_operator_oprname_l_r_n_index, 2689, on pg_operator using btree(oprname name_ops, oprleft oid_ops, oprright oid_ops, oprnamespace oid_ops));
 #define OperatorNameNspIndexId 2689
index c00eda07853280c250fc02f243a72f50caf18e24..18385a6fd6c095a20ec5f349ac03392ca10a27ac 100644 (file)
@@ -52,7 +52,7 @@ typedef FormData_pg_opfamily *Form_pg_opfamily;
 
 DECLARE_UNIQUE_INDEX(pg_opfamily_am_name_nsp_index, 2754, on pg_opfamily using btree(opfmethod oid_ops, opfname name_ops, opfnamespace oid_ops));
 #define OpfamilyAmNameNspIndexId  2754
-DECLARE_UNIQUE_INDEX(pg_opfamily_oid_index, 2755, on pg_opfamily using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_opfamily_oid_index, 2755, on pg_opfamily using btree(oid oid_ops));
 #define OpfamilyOidIndexId 2755
 
 #ifdef EXPOSE_TO_CLIENT_CODE
index f51d7e16bf991dbbc365bcb3a85b4746e58b606f..038730b00536c9724de45078df161265885382e9 100644 (file)
@@ -66,7 +66,7 @@ typedef FormData_pg_partitioned_table *Form_pg_partitioned_table;
 
 DECLARE_TOAST(pg_partitioned_table, 4165, 4166);
 
-DECLARE_UNIQUE_INDEX(pg_partitioned_table_partrelid_index, 3351, on pg_partitioned_table using btree(partrelid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_partitioned_table_partrelid_index, 3351, on pg_partitioned_table using btree(partrelid oid_ops));
 #define PartitionedRelidIndexId             3351
 
 #endif                         /* PG_PARTITIONED_TABLE_H */
index a5af6eb352ba93d3576a8c97408f2243eafc3fb7..44197613e06bef0a53b1495297b709ae5e284913 100644 (file)
@@ -51,7 +51,7 @@ typedef FormData_pg_policy *Form_pg_policy;
 
 DECLARE_TOAST(pg_policy, 4167, 4168);
 
-DECLARE_UNIQUE_INDEX(pg_policy_oid_index, 3257, on pg_policy using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_policy_oid_index, 3257, on pg_policy using btree(oid oid_ops));
 #define PolicyOidIndexId               3257
 DECLARE_UNIQUE_INDEX(pg_policy_polrelid_polname_index, 3258, on pg_policy using btree(polrelid oid_ops, polname name_ops));
 #define PolicyPolrelidPolnameIndexId               3258
index 1c2551c93273201411ea10ffa32e82fdc6769c68..03c8bef42274d56c110ce243eaa50f5205e4e3d8 100644 (file)
@@ -134,7 +134,7 @@ typedef FormData_pg_proc *Form_pg_proc;
 
 DECLARE_TOAST(pg_proc, 2836, 2837);
 
-DECLARE_UNIQUE_INDEX(pg_proc_oid_index, 2690, on pg_proc using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_proc_oid_index, 2690, on pg_proc using btree(oid oid_ops));
 #define ProcedureOidIndexId  2690
 DECLARE_UNIQUE_INDEX(pg_proc_proname_args_nsp_index, 2691, on pg_proc using btree(proname name_ops, proargtypes oidvector_ops, pronamespace oid_ops));
 #define ProcedureNameArgsNspIndexId  2691
index 0dd50fe428fe76b9c31b757b1fcefed1c8765ba6..4127611f5a6b5ffa13eb508179dbfec2ab7a4a5d 100644 (file)
@@ -63,7 +63,7 @@ CATALOG(pg_publication,6104,PublicationRelationId)
  */
 typedef FormData_pg_publication *Form_pg_publication;
 
-DECLARE_UNIQUE_INDEX(pg_publication_oid_index, 6110, on pg_publication using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_publication_oid_index, 6110, on pg_publication using btree(oid oid_ops));
 #define PublicationObjectIndexId 6110
 DECLARE_UNIQUE_INDEX(pg_publication_pubname_index, 6111, on pg_publication using btree(pubname name_ops));
 #define PublicationNameIndexId 6111
index 6e6ec6444d17482df1f6bf1c8745674570405336..c79b7fb4874a5c5ffb4292dfc988509b2a1a139b 100644 (file)
@@ -40,7 +40,7 @@ CATALOG(pg_publication_rel,6106,PublicationRelRelationId)
  */
 typedef FormData_pg_publication_rel *Form_pg_publication_rel;
 
-DECLARE_UNIQUE_INDEX(pg_publication_rel_oid_index, 6112, on pg_publication_rel using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_publication_rel_oid_index, 6112, on pg_publication_rel using btree(oid oid_ops));
 #define PublicationRelObjectIndexId 6112
 DECLARE_UNIQUE_INDEX(pg_publication_rel_prrelid_prpubid_index, 6113, on pg_publication_rel using btree(prrelid oid_ops, prpubid oid_ops));
 #define PublicationRelPrrelidPrpubidIndexId 6113
index f0c389718448018d3c783946645ff6ff5b7e0ddc..2ec6a4b126bb294e54e34cba189970f912652677 100644 (file)
@@ -57,7 +57,7 @@ CATALOG(pg_range,3541,RangeRelationId)
  */
 typedef FormData_pg_range *Form_pg_range;
 
-DECLARE_UNIQUE_INDEX(pg_range_rngtypid_index, 3542, on pg_range using btree(rngtypid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_range_rngtypid_index, 3542, on pg_range using btree(rngtypid oid_ops));
 #define RangeTypidIndexId                  3542
 
 DECLARE_UNIQUE_INDEX(pg_range_rngmultitypid_index, 2228, on pg_range using btree(rngmultitypid oid_ops));
index bd44968f886762ce4aa78d799a8f956f8ebf4c05..184f2403ceb0f5e1b197e104a5bc2201e74719f7 100644 (file)
@@ -58,7 +58,7 @@ DECLARE_TOAST(pg_replication_origin, 4181, 4182);
 #define PgReplicationOriginToastTable 4181
 #define PgReplicationOriginToastIndex 4182
 
-DECLARE_UNIQUE_INDEX(pg_replication_origin_roiident_index, 6001, on pg_replication_origin using btree(roident oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_replication_origin_roiident_index, 6001, on pg_replication_origin using btree(roident oid_ops));
 #define ReplicationOriginIdentIndex 6001
 DECLARE_UNIQUE_INDEX(pg_replication_origin_roname_index, 6002, on pg_replication_origin using btree(roname text_ops));
 #define ReplicationOriginNameIndex 6002
index 61615cea210263ac648aa4c2bad7ac7859078db2..36f92b1cf1358ffd82c0e7fac9bf990294074ea0 100644 (file)
@@ -53,7 +53,7 @@ typedef FormData_pg_rewrite *Form_pg_rewrite;
 
 DECLARE_TOAST(pg_rewrite, 2838, 2839);
 
-DECLARE_UNIQUE_INDEX(pg_rewrite_oid_index, 2692, on pg_rewrite using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_rewrite_oid_index, 2692, on pg_rewrite using btree(oid oid_ops));
 #define RewriteOidIndexId  2692
 DECLARE_UNIQUE_INDEX(pg_rewrite_rel_rulename_index, 2693, on pg_rewrite using btree(ev_class oid_ops, rulename name_ops));
 #define RewriteRelRulenameIndexId  2693
index caf67ab760601015015e278f55fb9e24911858ea..b14fd7febe8148960977fc9b745991385035ccf0 100644 (file)
@@ -39,7 +39,7 @@ CATALOG(pg_seclabel,3596,SecLabelRelationId)
 
 DECLARE_TOAST(pg_seclabel, 3598, 3599);
 
-DECLARE_UNIQUE_INDEX(pg_seclabel_object_index, 3597, on pg_seclabel using btree(objoid oid_ops, classoid oid_ops, objsubid int4_ops, provider text_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_seclabel_object_index, 3597, on pg_seclabel using btree(objoid oid_ops, classoid oid_ops, objsubid int4_ops, provider text_ops));
 #define SecLabelObjectIndexId              3597
 
 #endif                         /* PG_SECLABEL_H */
index 61fe5a1930ce3e0678796e43442dc7fdf03c0649..addf21abce95baf1513fa1f38fd32598c3db94cc 100644 (file)
@@ -39,7 +39,7 @@ CATALOG(pg_sequence,2224,SequenceRelationId)
  */
 typedef FormData_pg_sequence *Form_pg_sequence;
 
-DECLARE_UNIQUE_INDEX(pg_sequence_seqrelid_index, 5002, on pg_sequence using btree(seqrelid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_sequence_seqrelid_index, 5002, on pg_sequence using btree(seqrelid oid_ops));
 #define SequenceRelidIndexId   5002
 
 #endif                         /* PG_SEQUENCE_H */
index 5ecb95c00cf255416ea0240d5f3225dd7233ade6..a37db4fa0b44e953a69f3d625fb3d049022affc7 100644 (file)
@@ -59,7 +59,7 @@ DECLARE_TOAST(pg_shdescription, 2846, 2847);
 #define PgShdescriptionToastTable 2846
 #define PgShdescriptionToastIndex 2847
 
-DECLARE_UNIQUE_INDEX(pg_shdescription_o_c_index, 2397, on pg_shdescription using btree(objoid oid_ops, classoid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_shdescription_o_c_index, 2397, on pg_shdescription using btree(objoid oid_ops, classoid oid_ops));
 #define SharedDescriptionObjIndexId 2397
 
 #endif                         /* PG_SHDESCRIPTION_H */
index dd8900316913f4d4a0778a44ff9bd1ec3a6c000a..406f5328a70312693510e8d9f2cbae4bb178bd53 100644 (file)
@@ -42,7 +42,7 @@ DECLARE_TOAST(pg_shseclabel, 4060, 4061);
 #define PgShseclabelToastTable 4060
 #define PgShseclabelToastIndex 4061
 
-DECLARE_UNIQUE_INDEX(pg_shseclabel_object_index, 3593, on pg_shseclabel using btree(objoid oid_ops, classoid oid_ops, provider text_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_shseclabel_object_index, 3593, on pg_shseclabel using btree(objoid oid_ops, classoid oid_ops, provider text_ops));
 #define SharedSecLabelObjectIndexId            3593
 
 #endif                         /* PG_SHSECLABEL_H */
index 3f1534c29a26f0f45e24bffe553075e1fa984bbf..4a66bda879ca3508376dd854edb0bfaab4697237 100644 (file)
@@ -135,7 +135,7 @@ typedef FormData_pg_statistic *Form_pg_statistic;
 
 DECLARE_TOAST(pg_statistic, 2840, 2841);
 
-DECLARE_UNIQUE_INDEX(pg_statistic_relid_att_inh_index, 2696, on pg_statistic using btree(starelid oid_ops, staattnum int2_ops, stainherit bool_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_statistic_relid_att_inh_index, 2696, on pg_statistic using btree(starelid oid_ops, staattnum int2_ops, stainherit bool_ops));
 #define StatisticRelidAttnumInhIndexId 2696
 
 #ifdef EXPOSE_TO_CLIENT_CODE
index 99f6cea0a5349b9f12e3b39cdc3c616da096884f..10f52f912cb7f464768541f087813511d5e53eb4 100644 (file)
@@ -65,7 +65,7 @@ typedef FormData_pg_statistic_ext *Form_pg_statistic_ext;
 
 DECLARE_TOAST(pg_statistic_ext, 3439, 3440);
 
-DECLARE_UNIQUE_INDEX(pg_statistic_ext_oid_index, 3380, on pg_statistic_ext using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_statistic_ext_oid_index, 3380, on pg_statistic_ext using btree(oid oid_ops));
 #define StatisticExtOidIndexId 3380
 DECLARE_UNIQUE_INDEX(pg_statistic_ext_name_index, 3997, on pg_statistic_ext using btree(stxname name_ops, stxnamespace oid_ops));
 #define StatisticExtNameIndexId 3997
index e0aa152f7b648915f32a0d6dfbfdb6f410e6035b..6f7a36c14181a9cf73700f2f682906a55c814f66 100644 (file)
@@ -51,7 +51,7 @@ typedef FormData_pg_statistic_ext_data * Form_pg_statistic_ext_data;
 
 DECLARE_TOAST(pg_statistic_ext_data, 3430, 3431);
 
-DECLARE_UNIQUE_INDEX(pg_statistic_ext_data_stxoid_index, 3433, on pg_statistic_ext_data using btree(stxoid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_statistic_ext_data_stxoid_index, 3433, on pg_statistic_ext_data using btree(stxoid oid_ops));
 #define StatisticExtDataStxoidIndexId 3433
 
 #endif                         /* PG_STATISTIC_EXT_DATA_H */
index e3618028f7eedbe0eab9737a938959951bcf1f84..4e44c291496319a9001d83de28d803f9c142368c 100644 (file)
@@ -74,7 +74,7 @@ DECLARE_TOAST(pg_subscription, 4183, 4184);
 #define PgSubscriptionToastTable 4183
 #define PgSubscriptionToastIndex 4184
 
-DECLARE_UNIQUE_INDEX(pg_subscription_oid_index, 6114, on pg_subscription using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_subscription_oid_index, 6114, on pg_subscription using btree(oid oid_ops));
 #define SubscriptionObjectIndexId 6114
 DECLARE_UNIQUE_INDEX(pg_subscription_subname_index, 6115, on pg_subscription using btree(subdbid oid_ops, subname name_ops));
 #define SubscriptionNameIndexId 6115
index 06663b9f16cd1b6cf00160effd10512e9fc4d464..ab1202cf9bff8c89881a5f595f635ff1f0f28f97 100644 (file)
@@ -49,7 +49,7 @@ CATALOG(pg_subscription_rel,6102,SubscriptionRelRelationId)
 
 typedef FormData_pg_subscription_rel *Form_pg_subscription_rel;
 
-DECLARE_UNIQUE_INDEX(pg_subscription_rel_srrelid_srsubid_index, 6117, on pg_subscription_rel using btree(srrelid oid_ops, srsubid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_subscription_rel_srrelid_srsubid_index, 6117, on pg_subscription_rel using btree(srrelid oid_ops, srsubid oid_ops));
 #define SubscriptionRelSrrelidSrsubidIndexId 6117
 
 #ifdef EXPOSE_TO_CLIENT_CODE
index ff92e20c5bfe32cf4c964109db7ab5cb9fac70b7..6a6c66a61c84856a16048d8996a1142f1d0c941c 100644 (file)
@@ -49,7 +49,7 @@ DECLARE_TOAST(pg_tablespace, 4185, 4186);
 #define PgTablespaceToastTable 4185
 #define PgTablespaceToastIndex 4186
 
-DECLARE_UNIQUE_INDEX(pg_tablespace_oid_index, 2697, on pg_tablespace using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_tablespace_oid_index, 2697, on pg_tablespace using btree(oid oid_ops));
 #define TablespaceOidIndexId  2697
 DECLARE_UNIQUE_INDEX(pg_tablespace_spcname_index, 2698, on pg_tablespace using btree(spcname name_ops));
 #define TablespaceNameIndexId  2698
index 474baf35473fb4dbc0c28d18dd16251ce8b5050d..ad25db1841199bdf47d4bea9dbac0cd10396610e 100644 (file)
@@ -42,7 +42,7 @@ CATALOG(pg_transform,3576,TransformRelationId)
  */
 typedef FormData_pg_transform *Form_pg_transform;
 
-DECLARE_UNIQUE_INDEX(pg_transform_oid_index, 3574, on pg_transform using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_transform_oid_index, 3574, on pg_transform using btree(oid oid_ops));
 #define TransformOidIndexId 3574
 DECLARE_UNIQUE_INDEX(pg_transform_type_lang_index, 3575, on pg_transform using btree(trftype oid_ops, trflang oid_ops));
 #define TransformTypeLangIndexId  3575
index 9afea78900d9e66166eb759ee7afaa3ad3d625a8..55111ed864e9b4f9ba0cbce2040b441d2723fab7 100644 (file)
@@ -78,7 +78,7 @@ DECLARE_INDEX(pg_trigger_tgconstraint_index, 2699, on pg_trigger using btree(tgc
 #define TriggerConstraintIndexId  2699
 DECLARE_UNIQUE_INDEX(pg_trigger_tgrelid_tgname_index, 2701, on pg_trigger using btree(tgrelid oid_ops, tgname name_ops));
 #define TriggerRelidNameIndexId  2701
-DECLARE_UNIQUE_INDEX(pg_trigger_oid_index, 2702, on pg_trigger using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_trigger_oid_index, 2702, on pg_trigger using btree(oid oid_ops));
 #define TriggerOidIndexId  2702
 
 #ifdef EXPOSE_TO_CLIENT_CODE
index aef7da0f76f6f8f0ef4d534cf63b2836c3b98b39..02ef1a1554404d44dc6d445eca165b93b09706e6 100644 (file)
@@ -49,7 +49,7 @@ typedef FormData_pg_ts_config *Form_pg_ts_config;
 
 DECLARE_UNIQUE_INDEX(pg_ts_config_cfgname_index, 3608, on pg_ts_config using btree(cfgname name_ops, cfgnamespace oid_ops));
 #define TSConfigNameNspIndexId 3608
-DECLARE_UNIQUE_INDEX(pg_ts_config_oid_index, 3712, on pg_ts_config using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_ts_config_oid_index, 3712, on pg_ts_config using btree(oid oid_ops));
 #define TSConfigOidIndexId 3712
 
 #endif                         /* PG_TS_CONFIG_H */
index 95901a94067d017fd80f717574f6f2930ba716ef..f39d14fd79579705dcea478d0e72646b6a00999c 100644 (file)
@@ -44,7 +44,7 @@ CATALOG(pg_ts_config_map,3603,TSConfigMapRelationId)
 
 typedef FormData_pg_ts_config_map *Form_pg_ts_config_map;
 
-DECLARE_UNIQUE_INDEX(pg_ts_config_map_index, 3609, on pg_ts_config_map using btree(mapcfg oid_ops, maptokentype int4_ops, mapseqno int4_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_ts_config_map_index, 3609, on pg_ts_config_map using btree(mapcfg oid_ops, maptokentype int4_ops, mapseqno int4_ops));
 #define TSConfigMapIndexId 3609
 
 #endif                         /* PG_TS_CONFIG_MAP_H */
index 814d0d4407a36b2eb962fa5421472af595817625..bfe3378ff893c5b2a17482e9fa1af8464d3d3897 100644 (file)
@@ -55,7 +55,7 @@ DECLARE_TOAST(pg_ts_dict, 4169, 4170);
 
 DECLARE_UNIQUE_INDEX(pg_ts_dict_dictname_index, 3604, on pg_ts_dict using btree(dictname name_ops, dictnamespace oid_ops));
 #define TSDictionaryNameNspIndexId 3604
-DECLARE_UNIQUE_INDEX(pg_ts_dict_oid_index, 3605, on pg_ts_dict using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_ts_dict_oid_index, 3605, on pg_ts_dict using btree(oid oid_ops));
 #define TSDictionaryOidIndexId 3605
 
 #endif                         /* PG_TS_DICT_H */
index 57480ebfaf25ac284b170336cd031cd4d25a4832..f9f22716fd4704cca41b003041a355b3ba96fee5 100644 (file)
@@ -56,7 +56,7 @@ typedef FormData_pg_ts_parser *Form_pg_ts_parser;
 
 DECLARE_UNIQUE_INDEX(pg_ts_parser_prsname_index, 3606, on pg_ts_parser using btree(prsname name_ops, prsnamespace oid_ops));
 #define TSParserNameNspIndexId 3606
-DECLARE_UNIQUE_INDEX(pg_ts_parser_oid_index, 3607, on pg_ts_parser using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_ts_parser_oid_index, 3607, on pg_ts_parser using btree(oid oid_ops));
 #define TSParserOidIndexId 3607
 
 #endif                         /* PG_TS_PARSER_H */
index c1c7fedbe704f5693b8d8f9c7d428946ad6d616a..ae91922688989284aab7966018f24824aadc5e6a 100644 (file)
@@ -47,7 +47,7 @@ typedef FormData_pg_ts_template *Form_pg_ts_template;
 
 DECLARE_UNIQUE_INDEX(pg_ts_template_tmplname_index, 3766, on pg_ts_template using btree(tmplname name_ops, tmplnamespace oid_ops));
 #define TSTemplateNameNspIndexId   3766
-DECLARE_UNIQUE_INDEX(pg_ts_template_oid_index, 3767, on pg_ts_template using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_ts_template_oid_index, 3767, on pg_ts_template using btree(oid oid_ops));
 #define TSTemplateOidIndexId   3767
 
 #endif                         /* PG_TS_TEMPLATE_H */
index 37345bec00e9eb70f89442beb35c87a9153c5202..0d6981bc879d14a54495c002612d59c81e2cb8e7 100644 (file)
@@ -262,7 +262,7 @@ typedef FormData_pg_type *Form_pg_type;
 
 DECLARE_TOAST(pg_type, 4171, 4172);
 
-DECLARE_UNIQUE_INDEX(pg_type_oid_index, 2703, on pg_type using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_type_oid_index, 2703, on pg_type using btree(oid oid_ops));
 #define TypeOidIndexId 2703
 DECLARE_UNIQUE_INDEX(pg_type_typname_nsp_index, 2704, on pg_type using btree(typname name_ops, typnamespace oid_ops));
 #define TypeNameNspIndexId 2704
index 358912501504186daa19b3c69229ea01b6d93dd2..cabca048a928b7d866b5f47cd47eb16c2cec15b0 100644 (file)
@@ -47,7 +47,7 @@ typedef FormData_pg_user_mapping *Form_pg_user_mapping;
 
 DECLARE_TOAST(pg_user_mapping, 4173, 4174);
 
-DECLARE_UNIQUE_INDEX(pg_user_mapping_oid_index, 174, on pg_user_mapping using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_user_mapping_oid_index, 174, on pg_user_mapping using btree(oid oid_ops));
 #define UserMappingOidIndexId  174
 DECLARE_UNIQUE_INDEX(pg_user_mapping_user_server_index, 175, on pg_user_mapping using btree(umuser oid_ops, umserver oid_ops));
 #define UserMappingUserServerIndexId   175
index ecd1505cdcd4f2a0bb10ffbdc49d2e4e4f37c6cb..4b2f63a95ed9d18fbb563985fc8b26614b17d762 100644 (file)
@@ -16,7 +16,7 @@ DETAIL:  System catalog modifications are currently disallowed.
 CREATE TABLE t1x (a int, b anyarray);
 ERROR:  column "b" has pseudo-type anyarray
 -- index on system catalog
-ALTER TABLE pg_namespace ADD UNIQUE USING INDEX pg_namespace_oid_index;
+ALTER TABLE pg_namespace ADD CONSTRAINT foo UNIQUE USING INDEX pg_namespace_nspname_index;
 ERROR:  permission denied: "pg_namespace" is a system catalog
 -- write to system catalog table as superuser
 -- (allowed even without allow_system_table_mods)
@@ -102,7 +102,8 @@ CREATE TABLE t1 (a int, b anyarray);
 ROLLBACK;
 -- index on system catalog
 BEGIN;
-ALTER TABLE pg_namespace ADD UNIQUE USING INDEX pg_namespace_oid_index;
+ALTER TABLE pg_namespace ADD CONSTRAINT foo UNIQUE USING INDEX pg_namespace_nspname_index;
+NOTICE:  ALTER TABLE / ADD CONSTRAINT USING INDEX will rename index "pg_namespace_nspname_index" to "foo"
 ROLLBACK;
 -- write to system catalog table as superuser
 BEGIN;
@@ -146,7 +147,6 @@ ALTER TABLE pg_description ALTER COLUMN description SET STATISTICS -1;
 ROLLBACK;
 -- foreign key referencing catalog
 BEGIN;
-ALTER TABLE pg_description ADD PRIMARY KEY USING INDEX pg_description_o_c_o_index;
 CREATE TABLE foo (a oid, b oid, c int, FOREIGN KEY (a, b, c) REFERENCES pg_description);
 ROLLBACK;
 -- RangeVarCallbackOwnsRelation()
index 5663570d312d036040d75ba2e15f6f64e9ede0e1..6bfc896ef9cf5f91d50c78b2b649eae80aa280ba 100644 (file)
@@ -18,7 +18,7 @@ CREATE TABLE pg_catalog.test (a int);
 CREATE TABLE t1x (a int, b anyarray);
 
 -- index on system catalog
-ALTER TABLE pg_namespace ADD UNIQUE USING INDEX pg_namespace_oid_index;
+ALTER TABLE pg_namespace ADD CONSTRAINT foo UNIQUE USING INDEX pg_namespace_nspname_index;
 
 -- write to system catalog table as superuser
 -- (allowed even without allow_system_table_mods)
@@ -104,7 +104,7 @@ ROLLBACK;
 
 -- index on system catalog
 BEGIN;
-ALTER TABLE pg_namespace ADD UNIQUE USING INDEX pg_namespace_oid_index;
+ALTER TABLE pg_namespace ADD CONSTRAINT foo UNIQUE USING INDEX pg_namespace_nspname_index;
 ROLLBACK;
 
 -- write to system catalog table as superuser
@@ -156,7 +156,6 @@ ROLLBACK;
 
 -- foreign key referencing catalog
 BEGIN;
-ALTER TABLE pg_description ADD PRIMARY KEY USING INDEX pg_description_o_c_o_index;
 CREATE TABLE foo (a oid, b oid, c int, FOREIGN KEY (a, b, c) REFERENCES pg_description);
 ROLLBACK;
 
index d40afeef784c9a167feb08a51d9bc979cd0835a8..9ebe28a78da30c8e0f54f7f7151bc07ccc472e9a 100644 (file)
@@ -43,6 +43,9 @@ WHERE refclassid = 0 OR refobjid = 0 OR
 -- whatever OID the test is complaining about must have been added later
 -- in initdb, where it intentionally isn't pinned.  Legitimate exceptions
 -- to that rule are listed in the comments in setup_depend().
+-- Currently, pg_rewrite is also listed by this check, even though it is
+-- covered by setup_depend().  That happens because there are no rules in
+-- the pinned data, but initdb creates some intentionally-not-pinned views.
 do $$
 declare relnm text;
   reloid oid;
@@ -73,7 +76,6 @@ loop
   end if;
 end loop;
 end$$;
-NOTICE:  pg_constraint contains unpinned initdb-created object(s)
 NOTICE:  pg_database contains unpinned initdb-created object(s)
 NOTICE:  pg_extension contains unpinned initdb-created object(s)
 NOTICE:  pg_rewrite contains unpinned initdb-created object(s)
@@ -109,3 +111,30 @@ ORDER BY 1, 2;
  pg_largeobject_metadata | lomacl        | aclitem[]
 (11 rows)
 
+-- system catalogs without primary keys
+--
+-- Current exceptions:
+-- * pg_depend, pg_shdepend don't have a unique key
+SELECT relname
+FROM pg_class
+WHERE relnamespace = 'pg_catalog'::regnamespace AND relkind = 'r'
+      AND pg_class.oid NOT IN (SELECT indrelid FROM pg_index WHERE indisprimary)
+ORDER BY 1;
+   relname   
+-------------
+ pg_depend
+ pg_shdepend
+(2 rows)
+
+-- system catalog unique indexes not wrapped in a constraint
+-- (There should be none.)
+SELECT relname
+FROM pg_class c JOIN pg_index i ON c.oid = i.indexrelid
+WHERE relnamespace = 'pg_catalog'::regnamespace AND relkind = 'i'
+      AND i.indisunique
+      AND c.oid NOT IN (SELECT conindid FROM pg_constraint)
+ORDER BY 1;
+ relname 
+---------
+(0 rows)
+
index 3ce32e47252660836caca323a801a5f5bb232b21..9699f5cc3b3bc67d9c49b7de37595d997af70433 100644 (file)
@@ -44,6 +44,9 @@ WHERE refclassid = 0 OR refobjid = 0 OR
 -- whatever OID the test is complaining about must have been added later
 -- in initdb, where it intentionally isn't pinned.  Legitimate exceptions
 -- to that rule are listed in the comments in setup_depend().
+-- Currently, pg_rewrite is also listed by this check, even though it is
+-- covered by setup_depend().  That happens because there are no rules in
+-- the pinned data, but initdb creates some intentionally-not-pinned views.
 
 do $$
 declare relnm text;
@@ -94,3 +97,24 @@ WHERE c.oid < 16384 AND
       relkind = 'r' AND
       attstorage != 'p'
 ORDER BY 1, 2;
+
+
+-- system catalogs without primary keys
+--
+-- Current exceptions:
+-- * pg_depend, pg_shdepend don't have a unique key
+SELECT relname
+FROM pg_class
+WHERE relnamespace = 'pg_catalog'::regnamespace AND relkind = 'r'
+      AND pg_class.oid NOT IN (SELECT indrelid FROM pg_index WHERE indisprimary)
+ORDER BY 1;
+
+
+-- system catalog unique indexes not wrapped in a constraint
+-- (There should be none.)
+SELECT relname
+FROM pg_class c JOIN pg_index i ON c.oid = i.indexrelid
+WHERE relnamespace = 'pg_catalog'::regnamespace AND relkind = 'i'
+      AND i.indisunique
+      AND c.oid NOT IN (SELECT conindid FROM pg_constraint)
+ORDER BY 1;
index 672bb2d65031f9f2cc3a36ea453f4c5b9a393dbb..4575e3f95f69cdec585ead0aab81c7594c2e9b17 100755 (executable)
@@ -71,6 +71,7 @@ if %DIST%==1 if exist src\interfaces\ecpg\preproc\c_kwlist_d.h del /q src\interf
 if %DIST%==1 if exist src\interfaces\ecpg\preproc\ecpg_kwlist_d.h del /q src\interfaces\ecpg\preproc\ecpg_kwlist_d.h
 if %DIST%==1 if exist src\interfaces\ecpg\preproc\preproc.y del /q src\interfaces\ecpg\preproc\preproc.y
 if %DIST%==1 if exist src\backend\catalog\postgres.bki del /q src\backend\catalog\postgres.bki
+if %DIST%==1 if exist src\backend\catalog\system_constraints.sql del /q src\backend\catalog\system_constraints.sql
 if %DIST%==1 if exist src\backend\catalog\schemapg.h del /q src\backend\catalog\schemapg.h
 if %DIST%==1 if exist src\backend\catalog\pg_*_d.h del /q src\backend\catalog\pg_*_d.h
 if %DIST%==1 if exist src\backend\catalog\bki-stamp del /q src\backend\catalog\bki-stamp