Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 2AC201EA2927 for ; Sat, 9 Jun 2012 03:52:39 -0300 (ADT) Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SdFXK-0000t0-Be for pgsql-bugs@postgresql.org; Sat, 09 Jun 2012 06:52:38 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SdFX6-0005LD-LN for pgsql-bugs@postgresql.org; Sat, 09 Jun 2012 06:52:25 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1SdFX6-0006GO-8a for pgsql-bugs@postgresql.org; Sat, 09 Jun 2012 06:52:24 +0000 Date: Sat, 09 Jun 2012 06:52:24 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #6681: pg_extension.extconfig after alter sequence drop table To: pgsql-bugs@postgresql.org From: phb.emaj@free.fr X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/81 X-Sequence-Number: 33308 The following bug has been logged on the website: Bug reference: 6681 Logged by: Philippe BEAUDOIN Email address: phb.emaj@free.fr PostgreSQL version: 9.1.4 Operating system: Linux Description: = When a table has been registered as an extension configuration table, it's oid is reported in the extconfig column of the pg_extension table. But once the table is dropped from the extension, it is still referenced in pg_extension.extconfig. Here is a test case to easily reproduce this issue. Just copy/paste and adjust initial parameters. #!/bin/sh export PGINST=3D/usr/local/pg913 export PGBIN=3D$PGINST/bin export PGEXT=3D$PGINST/share/postgresql/extension export PGHOST=3Dlocalhost export PGPORT=3D5913 export PGUSER=3Dpostgres export PGDATABASE=3Dphb echo "-----------------------------------------------------------------------" echo " Issue: extconfig from pg_extension after alter sequence drop table" echo "-----------------------------------------------------------------------" echo Connection parameters: $PGHOST - $PGPORT - $PGUSER - $PGDATABASE # Build the extension control file cat >$PGINST/share/postgresql/extension/phb.control <$PGEXT/phb--1.0.0.sql < Create the extension" $PGBIN/psql -ac "create extension phb;" $PGBIN/psql -ac "\dx+ phb" $PGBIN/psql -ac "select oid from pg_class where relname =3D 'tbl1';" $PGBIN/psql -ac "select * from pg_extension;" echo "--> OK, tbl1 is correctly referenced as a configuration tables" echo "--> Now remove tbl1 from the extension and look at the result" $PGBIN/psql -ac "alter extension phb drop table phb.tbl1;" $PGBIN/psql -ac "select * from pg_extension;" echo "--> Surprisingly, extconfig references tbl1 !!!" echo "--> However, tbl1 is really out of the extension." $PGBIN/psql -ac "\dx+ phb" echo "--> This is confirmed by a pg_dump output" $PGBIN/pg_dump -Fp echo "--> And the extension and the table can be dropped separately" $PGBIN/psql -ac "drop extension phb;" $PGBIN/psql -ac "\d phb.tbl1" $PGBIN/psql -ac "drop table phb.tbl1;" # cleanup the environment $PGBIN/psql template1 -ac "drop database phb;" rm $PGINST/share/postgresql/extension/phb*