gooderp18绿色标准版
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

59 linhas
2.3KB

  1. /* contrib/cube/cube--1.3--1.4.sql */
  2. -- complain if script is sourced in psql, rather than via ALTER EXTENSION
  3. \echo Use "ALTER EXTENSION cube UPDATE TO '1.4'" to load this file. \quit
  4. --
  5. -- Get rid of unnecessary compress and decompress support functions.
  6. --
  7. -- To be allowed to drop the opclass entry for a support function,
  8. -- we must change the entry's dependency type from 'internal' to 'auto',
  9. -- as though it were a loose member of the opfamily rather than being
  10. -- bound into a particular opclass. There's no SQL command for that,
  11. -- so fake it with a manual update on pg_depend.
  12. --
  13. DO LANGUAGE plpgsql
  14. $$
  15. DECLARE
  16. my_schema pg_catalog.text := pg_catalog.quote_ident(pg_catalog.current_schema());
  17. old_path pg_catalog.text := pg_catalog.current_setting('search_path');
  18. BEGIN
  19. -- for safety, transiently set search_path to just pg_catalog+pg_temp
  20. PERFORM pg_catalog.set_config('search_path', 'pg_catalog, pg_temp', true);
  21. UPDATE pg_catalog.pg_depend
  22. SET deptype = 'a'
  23. WHERE classid = 'pg_catalog.pg_amproc'::pg_catalog.regclass
  24. AND objid =
  25. (SELECT objid
  26. FROM pg_catalog.pg_depend
  27. WHERE classid = 'pg_catalog.pg_amproc'::pg_catalog.regclass
  28. AND refclassid = 'pg_catalog.pg_proc'::pg_catalog.regclass
  29. AND (refobjid = (my_schema || '.g_cube_compress(pg_catalog.internal)')::pg_catalog.regprocedure))
  30. AND refclassid = 'pg_catalog.pg_opclass'::pg_catalog.regclass
  31. AND deptype = 'i';
  32. UPDATE pg_catalog.pg_depend
  33. SET deptype = 'a'
  34. WHERE classid = 'pg_catalog.pg_amproc'::pg_catalog.regclass
  35. AND objid =
  36. (SELECT objid
  37. FROM pg_catalog.pg_depend
  38. WHERE classid = 'pg_catalog.pg_amproc'::pg_catalog.regclass
  39. AND refclassid = 'pg_catalog.pg_proc'::pg_catalog.regclass
  40. AND (refobjid = (my_schema || '.g_cube_decompress(pg_catalog.internal)')::pg_catalog.regprocedure))
  41. AND refclassid = 'pg_catalog.pg_opclass'::pg_catalog.regclass
  42. AND deptype = 'i';
  43. PERFORM pg_catalog.set_config('search_path', old_path, true);
  44. END
  45. $$;
  46. ALTER OPERATOR FAMILY gist_cube_ops USING gist drop function 3 (cube);
  47. ALTER EXTENSION cube DROP function g_cube_compress(pg_catalog.internal);
  48. DROP FUNCTION g_cube_compress(pg_catalog.internal);
  49. ALTER OPERATOR FAMILY gist_cube_ops USING gist drop function 4 (cube);
  50. ALTER EXTENSION cube DROP function g_cube_decompress(pg_catalog.internal);
  51. DROP FUNCTION g_cube_decompress(pg_catalog.internal);
上海开阖软件有限公司 沪ICP备12045867号-1