BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations
От | jeff@pgexperts.com |
---|---|
Тема | BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations |
Дата | |
Msg-id | E1SiEL6-0002u2-Ov@wrigleys.postgresql.org обсуждение исходный текст |
Ответы |
Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations
|
Список | pgsql-bugs |
The following bug has been logged on the website: Bug reference: 6704 Logged by: Jeff Frost Email address: jeff@pgexperts.com PostgreSQL version: 9.1.4 Operating system: Windows and Linux Description:=20=20=20=20=20=20=20=20 DROP and CREATE extension appear to work fine, but if you ALTER EXTENSION postgis SET SCHEMA foo, it leaves a few relations behind. Then if you drop that schema, you can't pg_dump the DB anymore. See reproducible test case below. Note a the bottom that even though the ALTER left items in the original schema, I'm able to drop that schema without CASCADE and also if I then DROP EXTENSION, it happily gets rid of those. Test case: pgx-test:~ $ createdb ext_test pgx-test:~ $ psql ext_test psql (9.1.4) Type "help" for help. ext_test=3D# create schema test; CREATE SCHEMA Time: 27.736 ms ext_test=3D# create EXTENSION postgis with schema test; CREATE EXTENSION Time: 764.102 ms ext_test=3D# alter EXTENSION postgis set schema public; ALTER EXTENSION Time: 221.224 ms ext_test=3D# select oid, nspname from pg_namespace ; oid | nspname=20=20=20=20=20=20=20 ---------+-------------------- 99 | pg_toast 11124 | pg_temp_1 11125 | pg_toast_temp_1 11 | pg_catalog 2200 | public 12257 | information_schema 6981446 | test (7 rows) Time: 0.256 ms ext_test=3D# select oid, relname, relnamespace from pg_class where relnamespace =3D 6981446; oid | relname | relnamespace=20 ---------+----------------------+-------------- 6981694 | spatial_ref_sys_pkey | 6981446 (1 row) Time: 36.072 ms ext_test=3D# select oid, proname, pronamespace from pg_proc where pronamesp= ace =3D 6981446; oid | proname | pronamespace=20 -----+---------+-------------- (0 rows) Time: 7.797 ms ext_test=3D# select oid, typname, typnamespace from pg_type where typnamesp= ace =3D 6981446; oid | typname | typnamespace=20 ---------+--------------------+-------------- 6981689 | spatial_ref_sys | 6981446 6981688 | _spatial_ref_sys | 6981446 6981995 | geography_columns | 6981446 6981994 | _geography_columns | 6981446 6982099 | geometry_columns | 6981446 6982098 | _geometry_columns | 6981446 6982541 | raster_columns | 6981446 6982540 | _raster_columns | 6981446 6982550 | raster_overviews | 6981446 6982549 | _raster_overviews | 6981446 (10 rows) Time: 7.844 ms ext_test=3D# select oid, conname, connamespace from pg_constraint where connamespace =3D 6981446; oid | conname | connamespace=20 ---------+----------------------------+-------------- 6981690 | spatial_ref_sys_srid_check | 6981446 6981695 | spatial_ref_sys_pkey | 6981446 (2 rows) Time: 0.201 ms ext_test=3D# DROP EXTENSION postgis ; DROP EXTENSION Time: 214.645 ms ext_test=3D# select oid, relname, relnamespace from pg_class where relnamespace =3D 6981446; oid | relname | relnamespace=20 -----+---------+-------------- (0 rows) Time: 49.484 ms ext_test=3D# select oid, proname, pronamespace from pg_proc where pronamesp= ace =3D 6981446; oid | proname | pronamespace=20 -----+---------+-------------- (0 rows) Time: 7.698 ms ext_test=3D# select oid, typname, typnamespace from pg_type where typnamesp= ace =3D 6981446; oid | typname | typnamespace=20 -----+---------+-------------- (0 rows) Time: 7.864 ms ext_test=3D# select oid, conname, connamespace from pg_constraint where connamespace =3D 6981446; oid | conname | connamespace=20 -----+---------+-------------- (0 rows) Time: 0.144 ms ext_test=3D#=20 ext_test=3D# \q
В списке pgsql-bugs по дате отправления:
Следующее
От: Tom LaneДата:
Сообщение: Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations