Prepare downgrade script and bump development version to 10.0-1

pull/4311/head
Nils Dijk 2020-11-06 16:00:49 +01:00
parent 3e5df81e89
commit d065bb495d
No known key found for this signature in database
GPG Key ID: CA1177EF9434F241
5 changed files with 69 additions and 7 deletions

View File

@ -26,7 +26,7 @@ CREATE EVENT TRIGGER cstore_ddl_event_end
ON ddl_command_end
EXECUTE PROCEDURE cstore_ddl_event_end_trigger();
CREATE FUNCTION public.cstore_table_size(relation regclass)
CREATE FUNCTION pg_catalog.cstore_table_size(relation regclass)
RETURNS bigint
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;

View File

@ -0,0 +1,45 @@
/* columnar--10.0-1--9.5-1.sql */
SET search_path TO cstore;
DO $proc$
BEGIN
IF substring(current_Setting('server_version'), '\d+')::int >= 12 THEN
EXECUTE $$
DROP FUNCTION pg_catalog.alter_cstore_table_reset(
table_name regclass,
block_row_count bool,
stripe_row_count bool,
compression bool);
DROP FUNCTION pg_catalog.alter_cstore_table_set(
table_name regclass,
block_row_count int,
stripe_row_count int,
compression name);
DROP ACCESS METHOD cstore_tableam;
DROP FUNCTION cstore_tableam_handler(internal);
$$;
END IF;
END$proc$;
DROP VIEW cstore_options;
DROP TABLE cstore_skipnodes;
DROP TABLE cstore_stripes;
DROP TABLE cstore_data_files;
DROP FUNCTION pg_catalog.cstore_table_size(relation regclass);
DROP EVENT TRIGGER cstore_ddl_event_end;
DROP FUNCTION cstore_ddl_event_end_trigger();
DROP FOREIGN DATA WRAPPER cstore_fdw;
DROP FUNCTION cstore_fdw_validator(text[], oid);
DROP FUNCTION cstore_fdw_handler();
RESET search_path;
DROP SCHEMA cstore;

View File

@ -1,2 +1,4 @@
-- citus--10.0-1--9.5-1
-- this is an empty downgrade path since citus--9.5-1--10.0-1.sql is empty for now
#include "../../../columnar/sql/downgrades/columnar--10.0-1--9.5-1.sql"

View File

@ -80,7 +80,7 @@ FROM pg_depend AS pgd,
WHERE pgd.refclassid = 'pg_extension'::regclass AND
pgd.refobjid = pge.oid AND
pge.extname = 'citus' AND
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test');
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'cstore');
count
---------------------------------------------------------------------
0
@ -465,9 +465,24 @@ SELECT * FROM print_extension_changes();
-- Snapshot of state at 10.0-1
ALTER EXTENSION citus UPDATE TO '10.0-1';
SELECT * FROM print_extension_changes();
previous_object | current_object
previous_object | current_object
---------------------------------------------------------------------
(0 rows)
| access method cstore_tableam
| event trigger cstore_ddl_event_end
| foreign-data wrapper cstore_fdw
| function alter_cstore_table_reset(regclass,boolean,boolean,boolean)
| function alter_cstore_table_set(regclass,integer,integer,name)
| function cstore.cstore_ddl_event_end_trigger()
| function cstore.cstore_fdw_handler()
| function cstore.cstore_fdw_validator(text[],oid)
| function cstore.cstore_tableam_handler(internal)
| function cstore_table_size(regclass)
| schema cstore
| table cstore.cstore_data_files
| table cstore.cstore_skipnodes
| table cstore.cstore_stripes
| view cstore.cstore_options
(15 rows)
DROP TABLE prev_objects, extension_diff;
-- show running version
@ -485,7 +500,7 @@ FROM pg_depend AS pgd,
WHERE pgd.refclassid = 'pg_extension'::regclass AND
pgd.refobjid = pge.oid AND
pge.extname = 'citus' AND
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test');
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'cstore');
count
---------------------------------------------------------------------
0

View File

@ -83,7 +83,7 @@ FROM pg_depend AS pgd,
WHERE pgd.refclassid = 'pg_extension'::regclass AND
pgd.refobjid = pge.oid AND
pge.extname = 'citus' AND
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test');
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'cstore');
-- DROP EXTENSION pre-created by the regression suite
@ -238,7 +238,7 @@ FROM pg_depend AS pgd,
WHERE pgd.refclassid = 'pg_extension'::regclass AND
pgd.refobjid = pge.oid AND
pge.extname = 'citus' AND
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test');
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'cstore');
-- see incompatible version errors out
RESET citus.enable_version_checks;