1 /* contrib/cube/cube--1.3--1.4.sql */
3 -- complain if script is sourced in psql, rather than via ALTER EXTENSION
4 \echo Use "ALTER EXTENSION cube UPDATE TO '1.4'" to load this file. \quit
7 -- Get rid of unnecessary compress and decompress support functions.
9 -- To be allowed to drop the opclass entry for a support function,
10 -- we must change the entry's dependency type from 'internal' to 'auto',
11 -- as though it were a loose member of the opfamily rather than being
12 -- bound into a particular opclass. There's no SQL command for that,
13 -- so fake it with a manual update on pg_depend.
18 my_schema pg_catalog.text := pg_catalog.quote_ident(pg_catalog.current_schema());
19 old_path pg_catalog.text := pg_catalog.current_setting('search_path');
21 -- for safety, transiently set search_path to just pg_catalog+pg_temp
22 PERFORM pg_catalog.set_config('search_path', 'pg_catalog, pg_temp', true);
24 UPDATE pg_catalog.pg_depend
26 WHERE classid = 'pg_catalog.pg_amproc'::pg_catalog.regclass
29 FROM pg_catalog.pg_depend
30 WHERE classid = 'pg_catalog.pg_amproc'::pg_catalog.regclass
31 AND refclassid = 'pg_catalog.pg_proc'::pg_catalog.regclass
32 AND (refobjid = (my_schema || '.g_cube_compress(pg_catalog.internal)')::pg_catalog.regprocedure))
33 AND refclassid = 'pg_catalog.pg_opclass'::pg_catalog.regclass
36 UPDATE pg_catalog.pg_depend
38 WHERE classid = 'pg_catalog.pg_amproc'::pg_catalog.regclass
41 FROM pg_catalog.pg_depend
42 WHERE classid = 'pg_catalog.pg_amproc'::pg_catalog.regclass
43 AND refclassid = 'pg_catalog.pg_proc'::pg_catalog.regclass
44 AND (refobjid = (my_schema || '.g_cube_decompress(pg_catalog.internal)')::pg_catalog.regprocedure))
45 AND refclassid = 'pg_catalog.pg_opclass'::pg_catalog.regclass
48 PERFORM pg_catalog.set_config('search_path', old_path, true);
52 ALTER OPERATOR FAMILY gist_cube_ops USING gist drop function 3 (cube);
53 ALTER EXTENSION cube DROP function g_cube_compress(pg_catalog.internal);
54 DROP FUNCTION g_cube_compress(pg_catalog.internal);
56 ALTER OPERATOR FAMILY gist_cube_ops USING gist drop function 4 (cube);
57 ALTER EXTENSION cube DROP function g_cube_decompress(pg_catalog.internal);
58 DROP FUNCTION g_cube_decompress(pg_catalog.internal);