[HACKERS] drop operator class..using .. left dependency behind.
От | Rajkumar Raghuwanshi |
---|---|
Тема | [HACKERS] drop operator class..using .. left dependency behind. |
Дата | |
Msg-id | CAKcux6nOM2GybPe_1tDJ30nXd-Sbxy_PughT=Re0s-6cCA9oJA@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: [HACKERS] drop operator class..using .. left dependency behind.
|
Список | pgsql-hackers |
Hi,
I have observed that even after dropping operator class, not able to drop schema containing it. below is a example.
postgres=# CREATE SCHEMA sch_test;
CREATE SCHEMA
postgres=# SET search_path TO 'sch_test';
SET
postgres=# CREATE OR REPLACE FUNCTION sch_test.dummy_hashint4_39779(a int4) RETURNS int4 AS $$ BEGIN RETURN a; END; $$ LANGUAGE 'plpgsql' IMMUTABLE;
CREATE FUNCTION
postgres=# CREATE OPERATOR CLASS sch_test.custom_opclass_test FOR TYPE int4 USING HASH AS OPERATOR 1 = , FUNCTION 1 sch_test.dummy_hashint4_39779(a int4);
CREATE OPERATOR CLASS
postgres=# DROP OPERATOR CLASS sch_test.custom_opclass_test USING HASH;
DROP OPERATOR CLASS
postgres=# DROP FUNCTION sch_test.dummy_hashint4_39779(a int4);
DROP FUNCTION
postgres=# RESET search_path;
RESET
postgres=# DROP SCHEMA sch_test;
ERROR: cannot drop schema sch_test because other objects depend on it
DETAIL: operator family sch_test.custom_opclass_test for access method hash depends on schema sch_test
HINT: Use DROP ... CASCADE to drop the dependent objects too.
when investigated found, entry still present in pg_opfamily.
postgres=# select * from pg_opfamily where opfname like 'custom_opclass_test%';
opfmethod | opfname | opfnamespace | opfowner
-----------+---------------------+--------------+----------
405 | custom_opclass_test | 16409 | 10
(1 row)
Is this expected behaviour??
Thanks & Regards,
I have observed that even after dropping operator class, not able to drop schema containing it. below is a example.
postgres=# CREATE SCHEMA sch_test;
CREATE SCHEMA
postgres=# SET search_path TO 'sch_test';
SET
postgres=# CREATE OR REPLACE FUNCTION sch_test.dummy_hashint4_39779(a int4) RETURNS int4 AS $$ BEGIN RETURN a; END; $$ LANGUAGE 'plpgsql' IMMUTABLE;
CREATE FUNCTION
postgres=# CREATE OPERATOR CLASS sch_test.custom_opclass_test FOR TYPE int4 USING HASH AS OPERATOR 1 = , FUNCTION 1 sch_test.dummy_hashint4_39779(a int4);
CREATE OPERATOR CLASS
postgres=# DROP OPERATOR CLASS sch_test.custom_opclass_test USING HASH;
DROP OPERATOR CLASS
postgres=# DROP FUNCTION sch_test.dummy_hashint4_39779(a int4);
DROP FUNCTION
postgres=# RESET search_path;
RESET
postgres=# DROP SCHEMA sch_test;
ERROR: cannot drop schema sch_test because other objects depend on it
DETAIL: operator family sch_test.custom_opclass_test for access method hash depends on schema sch_test
HINT: Use DROP ... CASCADE to drop the dependent objects too.
when investigated found, entry still present in pg_opfamily.
postgres=# select * from pg_opfamily where opfname like 'custom_opclass_test%';
opfmethod | opfname | opfnamespace | opfowner
-----------+---------------------+--------------+----------
405 | custom_opclass_test | 16409 | 10
(1 row)
Is this expected behaviour??
Thanks & Regards,
Rajkumar Raghuwanshi
QMG, EnterpriseDB Corporation
В списке pgsql-hackers по дате отправления: