Pin the built-in index access methods.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 19 May 2016 18:40:02 +0000 (14:40 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 19 May 2016 18:40:02 +0000 (14:40 -0400)
This was overlooked in commit 473b93287, which introduced DROP ACCESS
METHOD.  Although that command is restricted to superusers, we don't want
even superusers dropping the built-in methods; "DROP ACCESS METHOD btree"
in particular is unrecoverable from.  Pin these objects in the same way
that other initdb-created objects are pinned.

I chose to bump catversion for this fix.  That's not absolutely necessary
perhaps, but it will ensure that no 9.6 production systems are missing
the pin entries.

src/bin/initdb/initdb.c
src/include/catalog/catversion.h

index ec8c38ed5a44f8a235bbeaa72efbcaa645b81066..d4a5e7c5eee3a1b024db5091dce7d52323b1e5d9 100644 (file)
@@ -1664,6 +1664,8 @@ setup_depend(FILE *cmdfd)
        "INSERT INTO pg_depend SELECT 0,0,0, tableoid,oid,0, 'p' "
        " FROM pg_opfamily;\n\n",
        "INSERT INTO pg_depend SELECT 0,0,0, tableoid,oid,0, 'p' "
+       " FROM pg_am;\n\n",
+       "INSERT INTO pg_depend SELECT 0,0,0, tableoid,oid,0, 'p' "
        " FROM pg_amop;\n\n",
        "INSERT INTO pg_depend SELECT 0,0,0, tableoid,oid,0, 'p' "
        " FROM pg_amproc;\n\n",
index 08867fb06a32db5d98d999fd5db8cf368eeeb57c..743e9a6e55d2301bfbd939f8d4411cb2e6c58181 100644 (file)
@@ -53,6 +53,6 @@
  */
 
 /*                         yyyymmddN */
-#define CATALOG_VERSION_NO 201605051
+#define CATALOG_VERSION_NO 201605191
 
 #endif