mirror of https://github.com/citusdata/citus.git
Remove PG13 from CI and Configure (#7002)
DESCRIPTION: Drops PG13 Support This commit is the first phase of dropping PG13 support. It consists of the following: - Removes pg13 from CI tests Among other things, Citus upgrade tests should now use PG14. Earliest Citus version supporting PG14 is 10.2. We also pick 11.3 version for upgrade_pg_dist_cleanup tests. Therefore, we run the citus upgrade tests with versions 10.2 and 11.3. - Removes pg13 from configure script - Remove upgrade_columnar_metapage upgrade tests We populate first_row_number column of columnar.stripe table during citus 10.1-10.2 upgrade. Given that we start from citus 10.2.0, which is the oldest version supporting PG14, we don't have that upgrade path anymore. Hence we remove these tests. - Removes upgrade_pg_dist_object_test and upgrade_partition_constraints tests These upgrade tests require the citus old version to be less than 10.0. Given that we drop support for PG13, we run upgrade tests with PG14, which starts with 10.2. So we remove these upgrade tests. - Documents that upgrade_post_11 should upgrade from version less than 11 In this way we make sure we run citus_finalize_upgrade_to_citus11 script - Adds needed alternative output for upgrade_citus_finish_citus_upgrade Given that we use 11.3 as the citus old version as well, we add this alternative output because pg_catalog.citus_finish_citus_upgrade() makes sense if last_upgrade_major_version < 11. See below for reference: pg_catalog.citus_finish_citus_upgrade(): ... IF last_upgrade_major_version < 11 THEN PERFORM citus_finalize_upgrade_to_citus11(); performed_upgrade := true; END IF; IF NOT performed_upgrade THEN RAISE NOTICE 'already at the latest distributed schema version (%)', last_upgrade_version_string; RETURN; END IF; ... And that's it :) The second phase of dropping PG13 support will consist in removing all the PG13 specific compilation paths/tests in the Citus repo. Will be done soon.pull/6923/head
parent
002a88ae7f
commit
5bf163a27d
|
@ -6,10 +6,7 @@ orbs:
|
||||||
parameters:
|
parameters:
|
||||||
image_suffix:
|
image_suffix:
|
||||||
type: string
|
type: string
|
||||||
default: '-vf5dc39a'
|
default: '-vbab548a'
|
||||||
pg13_version:
|
|
||||||
type: string
|
|
||||||
default: '13.11'
|
|
||||||
pg14_version:
|
pg14_version:
|
||||||
type: string
|
type: string
|
||||||
default: '14.8'
|
default: '14.8'
|
||||||
|
@ -18,7 +15,7 @@ parameters:
|
||||||
default: '15.3'
|
default: '15.3'
|
||||||
upgrade_pg_versions:
|
upgrade_pg_versions:
|
||||||
type: string
|
type: string
|
||||||
default: '13.11-14.8-15.3'
|
default: '14.8-15.3'
|
||||||
style_checker_tools_version:
|
style_checker_tools_version:
|
||||||
type: string
|
type: string
|
||||||
default: '0.8.18'
|
default: '0.8.18'
|
||||||
|
@ -565,7 +562,7 @@ jobs:
|
||||||
|
|
||||||
check-merge-to-enterprise:
|
check-merge-to-enterprise:
|
||||||
docker:
|
docker:
|
||||||
- image: citus/extbuilder:<< pipeline.parameters.pg13_version >>
|
- image: citus/extbuilder:<< pipeline.parameters.pg14_version >>
|
||||||
working_directory: /home/circleci/project
|
working_directory: /home/circleci/project
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
@ -717,10 +714,6 @@ workflows:
|
||||||
when:
|
when:
|
||||||
not: << pipeline.parameters.flaky_test >>
|
not: << pipeline.parameters.flaky_test >>
|
||||||
jobs:
|
jobs:
|
||||||
- build:
|
|
||||||
name: build-13
|
|
||||||
pg_major: 13
|
|
||||||
image_tag: '<< pipeline.parameters.pg13_version >>'
|
|
||||||
- build:
|
- build:
|
||||||
name: build-14
|
name: build-14
|
||||||
pg_major: 14
|
pg_major: 14
|
||||||
|
@ -733,79 +726,6 @@ workflows:
|
||||||
- check-style
|
- check-style
|
||||||
- check-sql-snapshots
|
- check-sql-snapshots
|
||||||
|
|
||||||
- test-citus: &test-citus-13
|
|
||||||
name: 'test-13_check-multi'
|
|
||||||
make: check-multi
|
|
||||||
pg_major: 13
|
|
||||||
image_tag: '<< pipeline.parameters.pg13_version >>'
|
|
||||||
requires: [build-13]
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-multi-1'
|
|
||||||
make: check-multi-1
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-mx'
|
|
||||||
make: check-multi-mx
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-vanilla'
|
|
||||||
make: check-vanilla
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-isolation'
|
|
||||||
make: check-isolation
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-operations'
|
|
||||||
make: check-operations
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-follower-cluster'
|
|
||||||
make: check-follower-cluster
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-columnar'
|
|
||||||
make: check-columnar
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-columnar-isolation'
|
|
||||||
make: check-columnar-isolation
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-failure'
|
|
||||||
image: citus/failtester
|
|
||||||
make: check-failure
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-enterprise'
|
|
||||||
make: check-enterprise
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-enterprise-isolation'
|
|
||||||
make: check-enterprise-isolation
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-enterprise-isolation-logicalrep-1'
|
|
||||||
make: check-enterprise-isolation-logicalrep-1
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-enterprise-isolation-logicalrep-2'
|
|
||||||
make: check-enterprise-isolation-logicalrep-2
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-enterprise-isolation-logicalrep-3'
|
|
||||||
make: check-enterprise-isolation-logicalrep-3
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-enterprise-failure'
|
|
||||||
image: citus/failtester
|
|
||||||
make: check-enterprise-failure
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-split'
|
|
||||||
make: check-split
|
|
||||||
|
|
||||||
- test-citus: &test-citus-14
|
- test-citus: &test-citus-14
|
||||||
name: 'test-14_check-split'
|
name: 'test-14_check-split'
|
||||||
make: check-split
|
make: check-split
|
||||||
|
@ -952,12 +872,6 @@ workflows:
|
||||||
image: citus/failtester
|
image: citus/failtester
|
||||||
make: check-failure
|
make: check-failure
|
||||||
|
|
||||||
- test-pytest:
|
|
||||||
name: 'test-13_pytest'
|
|
||||||
pg_major: 13
|
|
||||||
image_tag: '<< pipeline.parameters.pg13_version >>'
|
|
||||||
requires: [build-13]
|
|
||||||
|
|
||||||
- test-pytest:
|
- test-pytest:
|
||||||
name: 'test-14_pytest'
|
name: 'test-14_pytest'
|
||||||
pg_major: 14
|
pg_major: 14
|
||||||
|
@ -977,12 +891,6 @@ workflows:
|
||||||
image_tag: '<< pipeline.parameters.pg15_version >>'
|
image_tag: '<< pipeline.parameters.pg15_version >>'
|
||||||
requires: [build-15]
|
requires: [build-15]
|
||||||
|
|
||||||
- test-arbitrary-configs:
|
|
||||||
name: 'test-13_check-arbitrary-configs'
|
|
||||||
pg_major: 13
|
|
||||||
image_tag: '<< pipeline.parameters.pg13_version >>'
|
|
||||||
requires: [build-13]
|
|
||||||
|
|
||||||
- test-arbitrary-configs:
|
- test-arbitrary-configs:
|
||||||
name: 'test-14_check-arbitrary-configs'
|
name: 'test-14_check-arbitrary-configs'
|
||||||
pg_major: 14
|
pg_major: 14
|
||||||
|
@ -995,12 +903,6 @@ workflows:
|
||||||
image_tag: '<< pipeline.parameters.pg15_version >>'
|
image_tag: '<< pipeline.parameters.pg15_version >>'
|
||||||
requires: [build-15]
|
requires: [build-15]
|
||||||
|
|
||||||
- test-query-generator:
|
|
||||||
name: 'test-13_check-query-generator'
|
|
||||||
pg_major: 13
|
|
||||||
image_tag: '<< pipeline.parameters.pg13_version >>'
|
|
||||||
requires: [build-13]
|
|
||||||
|
|
||||||
- test-query-generator:
|
- test-query-generator:
|
||||||
name: 'test-14_check-query-generator'
|
name: 'test-14_check-query-generator'
|
||||||
pg_major: 14
|
pg_major: 14
|
||||||
|
@ -1013,13 +915,6 @@ workflows:
|
||||||
image_tag: '<< pipeline.parameters.pg15_version >>'
|
image_tag: '<< pipeline.parameters.pg15_version >>'
|
||||||
requires: [build-15]
|
requires: [build-15]
|
||||||
|
|
||||||
- test-pg-upgrade:
|
|
||||||
name: 'test-13-14_check-pg-upgrade'
|
|
||||||
old_pg_major: 13
|
|
||||||
new_pg_major: 14
|
|
||||||
image_tag: '<< pipeline.parameters.upgrade_pg_versions >>'
|
|
||||||
requires: [build-13, build-14]
|
|
||||||
|
|
||||||
- test-pg-upgrade:
|
- test-pg-upgrade:
|
||||||
name: 'test-14-15_check-pg-upgrade'
|
name: 'test-14-15_check-pg-upgrade'
|
||||||
old_pg_major: 14
|
old_pg_major: 14
|
||||||
|
@ -1028,32 +923,13 @@ workflows:
|
||||||
requires: [build-14, build-15]
|
requires: [build-14, build-15]
|
||||||
|
|
||||||
- test-citus-upgrade:
|
- test-citus-upgrade:
|
||||||
name: test-13_check-citus-upgrade
|
name: test-14_check-citus-upgrade
|
||||||
pg_major: 13
|
pg_major: 14
|
||||||
image_tag: '<< pipeline.parameters.pg13_version >>'
|
image_tag: '<< pipeline.parameters.pg14_version >>'
|
||||||
requires: [build-13]
|
requires: [build-14]
|
||||||
|
|
||||||
- upload-coverage:
|
- upload-coverage:
|
||||||
requires:
|
requires:
|
||||||
- test-13_check-multi
|
|
||||||
- test-13_check-multi-1
|
|
||||||
- test-13_check-mx
|
|
||||||
- test-13_check-vanilla
|
|
||||||
- test-13_check-isolation
|
|
||||||
- test-13_check-operations
|
|
||||||
- test-13_check-follower-cluster
|
|
||||||
- test-13_check-columnar
|
|
||||||
- test-13_check-columnar-isolation
|
|
||||||
- test-13_check-failure
|
|
||||||
- test-13_check-enterprise
|
|
||||||
- test-13_check-enterprise-isolation
|
|
||||||
- test-13_check-enterprise-isolation-logicalrep-1
|
|
||||||
- test-13_check-enterprise-isolation-logicalrep-2
|
|
||||||
- test-13_check-enterprise-isolation-logicalrep-3
|
|
||||||
- test-13_check-enterprise-failure
|
|
||||||
- test-13_check-split
|
|
||||||
- test-13_check-arbitrary-configs
|
|
||||||
- test-13_check-query-generator
|
|
||||||
- test-14_check-multi
|
- test-14_check-multi
|
||||||
- test-14_check-multi-1
|
- test-14_check-multi-1
|
||||||
- test-14_check-mx
|
- test-14_check-mx
|
||||||
|
@ -1092,18 +968,17 @@ workflows:
|
||||||
- test-15_check-split
|
- test-15_check-split
|
||||||
- test-15_check-arbitrary-configs
|
- test-15_check-arbitrary-configs
|
||||||
- test-15_check-query-generator
|
- test-15_check-query-generator
|
||||||
- test-13-14_check-pg-upgrade
|
|
||||||
- test-14-15_check-pg-upgrade
|
- test-14-15_check-pg-upgrade
|
||||||
- test-13_check-citus-upgrade
|
- test-14_check-citus-upgrade
|
||||||
|
|
||||||
- ch_benchmark:
|
- ch_benchmark:
|
||||||
requires: [build-13]
|
requires: [build-14]
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- /ch_benchmark\/.*/ # match with ch_benchmark/ prefix
|
- /ch_benchmark\/.*/ # match with ch_benchmark/ prefix
|
||||||
- tpcc_benchmark:
|
- tpcc_benchmark:
|
||||||
requires: [build-13]
|
requires: [build-14]
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
|
|
|
@ -2588,7 +2588,7 @@ fi
|
||||||
if test "$with_pg_version_check" = no; then
|
if test "$with_pg_version_check" = no; then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: building against PostgreSQL $version_num (skipped compatibility check)" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: building against PostgreSQL $version_num (skipped compatibility check)" >&5
|
||||||
$as_echo "$as_me: building against PostgreSQL $version_num (skipped compatibility check)" >&6;}
|
$as_echo "$as_me: building against PostgreSQL $version_num (skipped compatibility check)" >&6;}
|
||||||
elif test "$version_num" != '13' -a "$version_num" != '14' -a "$version_num" != '15'; then
|
elif test "$version_num" != '14' -a "$version_num" != '15'; then
|
||||||
as_fn_error $? "Citus is not compatible with the detected PostgreSQL version ${version_num}." "$LINENO" 5
|
as_fn_error $? "Citus is not compatible with the detected PostgreSQL version ${version_num}." "$LINENO" 5
|
||||||
else
|
else
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: building against PostgreSQL $version_num" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: building against PostgreSQL $version_num" >&5
|
||||||
|
|
|
@ -80,7 +80,7 @@ AC_SUBST(with_pg_version_check)
|
||||||
|
|
||||||
if test "$with_pg_version_check" = no; then
|
if test "$with_pg_version_check" = no; then
|
||||||
AC_MSG_NOTICE([building against PostgreSQL $version_num (skipped compatibility check)])
|
AC_MSG_NOTICE([building against PostgreSQL $version_num (skipped compatibility check)])
|
||||||
elif test "$version_num" != '13' -a "$version_num" != '14' -a "$version_num" != '15'; then
|
elif test "$version_num" != '14' -a "$version_num" != '15'; then
|
||||||
AC_MSG_ERROR([Citus is not compatible with the detected PostgreSQL version ${version_num}.])
|
AC_MSG_ERROR([Citus is not compatible with the detected PostgreSQL version ${version_num}.])
|
||||||
else
|
else
|
||||||
AC_MSG_NOTICE([building against PostgreSQL $version_num])
|
AC_MSG_NOTICE([building against PostgreSQL $version_num])
|
||||||
|
|
|
@ -3,7 +3,4 @@
|
||||||
test: upgrade_citus_finish_citus_upgrade
|
test: upgrade_citus_finish_citus_upgrade
|
||||||
test: upgrade_pg_dist_cleanup_after
|
test: upgrade_pg_dist_cleanup_after
|
||||||
test: upgrade_basic_after
|
test: upgrade_basic_after
|
||||||
test: upgrade_partition_constraints_after
|
|
||||||
test: upgrade_pg_dist_object_test_after
|
|
||||||
test: upgrade_columnar_metapage_after
|
|
||||||
test: upgrade_post_11_after
|
test: upgrade_post_11_after
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
# this schedule is to be run on only coordinators
|
# this schedule is to be run on only coordinators
|
||||||
|
|
||||||
test: upgrade_basic_before
|
test: upgrade_basic_before
|
||||||
test: upgrade_partition_constraints_before
|
|
||||||
test: upgrade_pg_dist_object_test_before
|
|
||||||
test: upgrade_columnar_metapage_before
|
|
||||||
test: upgrade_pg_dist_cleanup_before
|
test: upgrade_pg_dist_cleanup_before
|
||||||
test: upgrade_post_11_before
|
test: upgrade_post_11_before
|
||||||
|
|
|
@ -211,9 +211,6 @@ s/ERROR: cannot append to shardId [0-9]+/ERROR: cannot append to shardId xxxxx
|
||||||
/local tables that are added to metadata automatically by citus, but not chained with reference tables via foreign keys might be automatically converted back to postgres tables$/d
|
/local tables that are added to metadata automatically by citus, but not chained with reference tables via foreign keys might be automatically converted back to postgres tables$/d
|
||||||
/Executing citus_add_local_table_to_metadata(.*) prevents this for the given relation, and all of the connected relations$/d
|
/Executing citus_add_local_table_to_metadata(.*) prevents this for the given relation, and all of the connected relations$/d
|
||||||
|
|
||||||
# normalize partitioned table shard constraint name errors for upgrade_partition_constraints_(before|after)
|
|
||||||
s/^(ERROR: child table is missing constraint "\w+)_([0-9])+"/\1_xxxxxx"/g
|
|
||||||
|
|
||||||
# normalize for distributed deadlock delay in isolation_metadata_sync_deadlock
|
# normalize for distributed deadlock delay in isolation_metadata_sync_deadlock
|
||||||
# isolation tester first detects a lock, but then deadlock detector cancels the
|
# isolation tester first detects a lock, but then deadlock detector cancels the
|
||||||
# session. Sometimes happens that deadlock detector cancels the session before
|
# session. Sometimes happens that deadlock detector cancels the session before
|
||||||
|
|
|
@ -90,7 +90,6 @@ def get_pg_major_version():
|
||||||
PG_MAJOR_VERSION = get_pg_major_version()
|
PG_MAJOR_VERSION = get_pg_major_version()
|
||||||
|
|
||||||
OLDEST_SUPPORTED_CITUS_VERSION_MATRIX = {
|
OLDEST_SUPPORTED_CITUS_VERSION_MATRIX = {
|
||||||
13: "9.5.0",
|
|
||||||
14: "10.2.0",
|
14: "10.2.0",
|
||||||
15: "11.1.5",
|
15: "11.1.5",
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,15 @@
|
||||||
-- Citus upgrades are finished by calling a procedure
|
-- Citus upgrades are finished by calling a procedure
|
||||||
|
-- Note that pg_catalog.citus_finish_citus_upgrade() behaves differently
|
||||||
|
-- when last upgrade citus version is less than 11
|
||||||
|
-- so we have two alternative outputs for this test
|
||||||
|
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
||||||
|
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 11
|
||||||
|
AS upgrade_test_old_citus_version_lt_11_0;
|
||||||
|
upgrade_test_old_citus_version_lt_11_0
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
|
||||||
-- this is a transactional procedure, so rollback should be fine
|
-- this is a transactional procedure, so rollback should be fine
|
||||||
BEGIN;
|
BEGIN;
|
||||||
CALL citus_finish_citus_upgrade();
|
CALL citus_finish_citus_upgrade();
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
-- Citus upgrades are finished by calling a procedure
|
||||||
|
-- Note that pg_catalog.citus_finish_citus_upgrade() behaves differently
|
||||||
|
-- when last upgrade citus version is less than 11
|
||||||
|
-- so we have two alternative outputs for this test
|
||||||
|
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
||||||
|
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 11
|
||||||
|
AS upgrade_test_old_citus_version_lt_11_0;
|
||||||
|
upgrade_test_old_citus_version_lt_11_0
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
f
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
-- this is a transactional procedure, so rollback should be fine
|
||||||
|
BEGIN;
|
||||||
|
CALL citus_finish_citus_upgrade();
|
||||||
|
NOTICE: already at the latest distributed schema version (11.3-1)
|
||||||
|
ROLLBACK;
|
||||||
|
-- do the actual job
|
||||||
|
CALL citus_finish_citus_upgrade();
|
||||||
|
NOTICE: already at the latest distributed schema version (11.3-1)
|
||||||
|
-- show that the upgrade is successfull
|
||||||
|
SELECT metadata->>'last_upgrade_version' = extversion
|
||||||
|
FROM pg_dist_node_metadata, pg_extension WHERE extname = 'citus';
|
||||||
|
?column?
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
f
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
-- idempotent, should be called multiple times
|
||||||
|
-- still, do not NOTICE the version as it changes per release
|
||||||
|
SET client_min_messages TO WARNING;
|
||||||
|
CALL citus_finish_citus_upgrade();
|
||||||
|
-- we should be able to sync metadata in nontransactional way as well
|
||||||
|
SET citus.metadata_sync_mode TO 'nontransactional';
|
||||||
|
SELECT start_metadata_sync_to_all_nodes();
|
||||||
|
start_metadata_sync_to_all_nodes
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
RESET citus.metadata_sync_mode;
|
|
@ -1,127 +0,0 @@
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int >= 10 AND
|
|
||||||
substring(:'upgrade_test_old_citus_version', 'v\d+\.(\d+)\.\d+')::int >= 0
|
|
||||||
AS upgrade_test_old_citus_version_ge_10_0;
|
|
||||||
upgrade_test_old_citus_version_ge_10_0
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
t
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_ge_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
||||||
\endif
|
|
||||||
-- it's not the best practice to define this here, but we don't want to include
|
|
||||||
-- columnar_test_helpers in upgrade test schedule
|
|
||||||
CREATE OR REPLACE FUNCTION columnar_storage_info(
|
|
||||||
rel regclass,
|
|
||||||
version_major OUT int4,
|
|
||||||
version_minor OUT int4,
|
|
||||||
storage_id OUT int8,
|
|
||||||
reserved_stripe_id OUT int8,
|
|
||||||
reserved_row_number OUT int8,
|
|
||||||
reserved_offset OUT int8)
|
|
||||||
STRICT
|
|
||||||
LANGUAGE c AS 'citus', 'columnar_storage_info';
|
|
||||||
CREATE VIEW columnar_table_stripe_info AS
|
|
||||||
SELECT columnar_table_storageids.relname relname,
|
|
||||||
columnar.stripe.stripe_num stripe_num,
|
|
||||||
columnar.stripe.row_count row_count,
|
|
||||||
columnar.stripe.first_row_number first_row_number
|
|
||||||
FROM columnar.stripe,
|
|
||||||
(
|
|
||||||
SELECT c.oid relid, c.relname relname, (columnar_storage_info(c.oid)).storage_id relstorageid
|
|
||||||
FROM pg_class c, pg_am a
|
|
||||||
WHERE c.relam = a.oid AND amname = 'columnar'
|
|
||||||
) columnar_table_storageids
|
|
||||||
WHERE relstorageid = columnar.stripe.storage_id;
|
|
||||||
SET search_path TO upgrade_columnar_metapage, public;
|
|
||||||
-- show that first_row_number values are equal to MAX(row_count) * stripe_num + COLUMNAR_FIRST_ROW_NUMBER
|
|
||||||
SELECT * FROM columnar_table_stripe_info ORDER BY relname, stripe_num;
|
|
||||||
relname | stripe_num | row_count | first_row_number
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
columnar_table_1 | 1 | 150000 | 1
|
|
||||||
columnar_table_1 | 2 | 10000 | 150001
|
|
||||||
columnar_table_2 | 1 | 1000 | 1
|
|
||||||
columnar_table_2 | 2 | 901 | 150001
|
|
||||||
columnar_table_3 | 1 | 2 | 1
|
|
||||||
(5 rows)
|
|
||||||
|
|
||||||
-- should work since we upgrade metapages when upgrading schema version
|
|
||||||
INSERT INTO columnar_table_1 VALUES (3);
|
|
||||||
-- state of stripe metadata for columnar_table_1 after post-upgrade insert
|
|
||||||
SELECT * FROM columnar_table_stripe_info WHERE relname = 'columnar_table_1' ORDER BY stripe_num;
|
|
||||||
relname | stripe_num | row_count | first_row_number
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
columnar_table_1 | 1 | 150000 | 1
|
|
||||||
columnar_table_1 | 2 | 10000 | 150001
|
|
||||||
columnar_table_1 | 3 | 1 | 160001
|
|
||||||
(3 rows)
|
|
||||||
|
|
||||||
-- show that all columnar relation's metapage's are upgraded to "2.0"
|
|
||||||
SELECT count(*)=0
|
|
||||||
FROM (SELECT (columnar_storage_info(c.oid)).* t
|
|
||||||
FROM pg_class c, pg_am a
|
|
||||||
WHERE c.relam = a.oid AND amname = 'columnar') t
|
|
||||||
WHERE t.version_major != 2 and t.version_minor != 0;
|
|
||||||
?column?
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
t
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
-- print metapage for two of the tables
|
|
||||||
SELECT version_major, version_minor, reserved_stripe_id, reserved_row_number
|
|
||||||
FROM columnar_storage_info('columnar_table_1');
|
|
||||||
version_major | version_minor | reserved_stripe_id | reserved_row_number
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
2 | 0 | 4 | 310001
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT version_major, version_minor, reserved_stripe_id, reserved_row_number
|
|
||||||
FROM columnar_storage_info('columnar_table_2');
|
|
||||||
version_major | version_minor | reserved_stripe_id | reserved_row_number
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
2 | 0 | 3 | 150902
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
-- show that no_data_columnar_table also has metapage after upgrade
|
|
||||||
SELECT version_major, version_minor, reserved_stripe_id, reserved_row_number
|
|
||||||
FROM columnar_storage_info('no_data_columnar_table');
|
|
||||||
version_major | version_minor | reserved_stripe_id | reserved_row_number
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
2 | 0 | 1 | 1
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
-- table is already upgraded, make sure that upgrade_columnar_metapage is no-op
|
|
||||||
SELECT columnar_internal.upgrade_columnar_storage(c.oid)
|
|
||||||
FROM pg_class c, pg_am a
|
|
||||||
WHERE c.relam = a.oid AND amname = 'columnar' and relname = 'columnar_table_2';
|
|
||||||
upgrade_columnar_storage
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT version_major, version_minor, reserved_stripe_id, reserved_row_number
|
|
||||||
FROM columnar_storage_info('columnar_table_2');
|
|
||||||
version_major | version_minor | reserved_stripe_id | reserved_row_number
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
2 | 0 | 3 | 150902
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
VACUUM FULL columnar_table_2;
|
|
||||||
-- print metapage and stripe metadata after post-upgrade vacuum full
|
|
||||||
SELECT version_major, version_minor, reserved_stripe_id, reserved_row_number
|
|
||||||
FROM columnar_storage_info('columnar_table_2');
|
|
||||||
version_major | version_minor | reserved_stripe_id | reserved_row_number
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
2 | 0 | 3 | 2001
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT * FROM columnar_table_stripe_info WHERE relname = 'columnar_table_2' ORDER BY stripe_num;
|
|
||||||
relname | stripe_num | row_count | first_row_number
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
columnar_table_2 | 1 | 1000 | 1
|
|
||||||
columnar_table_2 | 2 | 901 | 1001
|
|
||||||
(2 rows)
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int >= 10 AND
|
|
||||||
substring(:'upgrade_test_old_citus_version', 'v\d+\.(\d+)\.\d+')::int >= 0
|
|
||||||
AS upgrade_test_old_citus_version_ge_10_0;
|
|
||||||
upgrade_test_old_citus_version_ge_10_0
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
f
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_ge_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
|
@ -1,31 +0,0 @@
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int >= 10 AND
|
|
||||||
substring(:'upgrade_test_old_citus_version', 'v\d+\.(\d+)\.\d+')::int >= 0
|
|
||||||
AS upgrade_test_old_citus_version_ge_10_0;
|
|
||||||
upgrade_test_old_citus_version_ge_10_0
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
t
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_ge_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
||||||
\endif
|
|
||||||
CREATE SCHEMA upgrade_columnar_metapage;
|
|
||||||
SET search_path TO upgrade_columnar_metapage, public;
|
|
||||||
CREATE TABLE columnar_table_1(a INT, b INT) USING columnar;
|
|
||||||
INSERT INTO columnar_table_1 SELECT i FROM generate_series(160001, 320000) i;
|
|
||||||
CREATE TABLE columnar_table_2(b INT) USING columnar;
|
|
||||||
SELECT alter_columnar_table_set('columnar_table_2',
|
|
||||||
chunk_group_row_limit => 1000,
|
|
||||||
stripe_row_limit => 1000);
|
|
||||||
alter_columnar_table_set
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
INSERT INTO columnar_table_2 SELECT i FROM generate_series(1600, 3500) i;
|
|
||||||
CREATE TABLE columnar_table_3(b INT) USING columnar;
|
|
||||||
INSERT INTO columnar_table_3 VALUES (1), (2);
|
|
||||||
CREATE TABLE no_data_columnar_table(a INT, b INT, c TEXT) USING columnar;
|
|
|
@ -1,13 +0,0 @@
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int >= 10 AND
|
|
||||||
substring(:'upgrade_test_old_citus_version', 'v\d+\.(\d+)\.\d+')::int >= 0
|
|
||||||
AS upgrade_test_old_citus_version_ge_10_0;
|
|
||||||
upgrade_test_old_citus_version_ge_10_0
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
f
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_ge_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
|
@ -1,33 +0,0 @@
|
||||||
-- run this test only when old citus version is earlier than 10.0
|
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 10
|
|
||||||
AS upgrade_test_old_citus_version_lt_10_0;
|
|
||||||
upgrade_test_old_citus_version_lt_10_0
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
t
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_lt_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
||||||
\endif
|
|
||||||
-- test cases for #3970
|
|
||||||
SET search_path = test_3970;
|
|
||||||
--5. add a partition
|
|
||||||
-- This command will fail as the child table has a wrong constraint name
|
|
||||||
CREATE TABLE part_table_p202009 PARTITION OF part_table FOR VALUES FROM ('2020-09-01 00:00:00') TO ('2020-10-01 00:00:00');
|
|
||||||
ERROR: child table is missing constraint "ck_01234567890123456789012345678901234567890123_8478db72_xxxxxx"
|
|
||||||
CONTEXT: while executing command on localhost:xxxxx
|
|
||||||
-- fix constraint names on partitioned table shards
|
|
||||||
SELECT fix_pre_citus10_partitioned_table_constraint_names('part_table'::regclass);
|
|
||||||
fix_pre_citus10_partitioned_table_constraint_names
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
--5. add a partition
|
|
||||||
CREATE TABLE part_table_p202009 PARTITION OF part_table FOR VALUES FROM ('2020-09-01 00:00:00') TO ('2020-10-01 00:00:00');
|
|
||||||
RESET search_path;
|
|
||||||
DROP SCHEMA test_3970 CASCADE;
|
|
||||||
NOTICE: drop cascades to table test_3970.part_table
|
|
|
@ -1,44 +0,0 @@
|
||||||
-- run this test only when old citus version is earlier than 10.0
|
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 10
|
|
||||||
AS upgrade_test_old_citus_version_lt_10_0;
|
|
||||||
upgrade_test_old_citus_version_lt_10_0
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
t
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_lt_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
||||||
\endif
|
|
||||||
-- test cases for #3970
|
|
||||||
CREATE SCHEMA test_3970;
|
|
||||||
SET search_path = test_3970;
|
|
||||||
--1. create a partitioned table
|
|
||||||
CREATE TABLE part_table (
|
|
||||||
work_ymdt timestamp without time zone NOT NULL,
|
|
||||||
seq bigint NOT NULL,
|
|
||||||
my_seq bigint NOT NULL,
|
|
||||||
work_memo character varying(150),
|
|
||||||
CONSTRAINT work_memo_check CHECK ((octet_length((work_memo)::text) <= 150))
|
|
||||||
)
|
|
||||||
PARTITION BY RANGE (work_ymdt);
|
|
||||||
--2. perform create_distributed_table
|
|
||||||
SELECT create_distributed_table('part_table', 'seq');
|
|
||||||
create_distributed_table
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
--3. add a partition
|
|
||||||
CREATE TABLE part_table_p202008 PARTITION OF part_table FOR VALUES FROM ('2020-08-01 00:00:00') TO ('2020-09-01 00:00:00');
|
|
||||||
--4. add a check constraint
|
|
||||||
ALTER TABLE part_table ADD CONSTRAINT my_seq CHECK (my_seq > 0);
|
|
||||||
--5. add a partition
|
|
||||||
-- This command will fail as the child table has a wrong constraint name
|
|
||||||
CREATE TABLE part_table_p202009 PARTITION OF part_table FOR VALUES FROM ('2020-09-01 00:00:00') TO ('2020-10-01 00:00:00');
|
|
||||||
ERROR: child table is missing constraint "my_seq_xxxxxx"
|
|
||||||
CONTEXT: while executing command on localhost:xxxxx
|
|
||||||
-- Add another constraint with a long name that will get truncated with a hash
|
|
||||||
ALTER TABLE part_table ADD CONSTRAINT ck_012345678901234567890123456789012345678901234567890123456789 CHECK (my_seq > 0);
|
|
|
@ -1,13 +0,0 @@
|
||||||
-- run this test only when old citus version is earlier than 10.0
|
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 10
|
|
||||||
AS upgrade_test_old_citus_version_lt_10_0;
|
|
||||||
upgrade_test_old_citus_version_lt_10_0
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
f
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_lt_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
|
@ -1,90 +0,0 @@
|
||||||
-- run this test only when old citus version is earlier than 10.0
|
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 10
|
|
||||||
AS upgrade_test_old_citus_version_lt_10_0;
|
|
||||||
upgrade_test_old_citus_version_lt_10_0
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
t
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_lt_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
||||||
\endif
|
|
||||||
-- drop objects from previous test (uprade_basic_after.sql) for a clean test
|
|
||||||
-- drop upgrade_basic schema and switch back to public schema
|
|
||||||
SET search_path to public;
|
|
||||||
DROP SCHEMA upgrade_basic CASCADE;
|
|
||||||
NOTICE: drop cascades to 7 other objects
|
|
||||||
DETAIL: drop cascades to table upgrade_basic.t
|
|
||||||
drop cascades to table upgrade_basic.tp
|
|
||||||
drop cascades to table upgrade_basic.t_ab
|
|
||||||
drop cascades to table upgrade_basic.t2
|
|
||||||
drop cascades to table upgrade_basic.r
|
|
||||||
drop cascades to table upgrade_basic.tr
|
|
||||||
drop cascades to table upgrade_basic.t_range
|
|
||||||
-- as we updated citus to available version,
|
|
||||||
-- "isn" extension
|
|
||||||
-- "new_schema" schema
|
|
||||||
-- "public" schema
|
|
||||||
-- "fooschema" schema
|
|
||||||
-- "footype" type (under schema 'fooschema')
|
|
||||||
-- will now be marked as distributed
|
|
||||||
-- but,
|
|
||||||
-- "seg" extension
|
|
||||||
-- will not be marked as distributed
|
|
||||||
-- see underlying objects
|
|
||||||
SELECT i.* FROM pg_catalog.pg_dist_object, pg_identify_object_as_address(classid, objid, objsubid) i ORDER BY 1, 2, 3;
|
|
||||||
type | object_names | object_args
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
collation | {post_11_upgrade,german_phonebook_unpropagated} | {}
|
|
||||||
database | {postgres} | {}
|
|
||||||
extension | {plpgsql} | {}
|
|
||||||
function | {post_11_upgrade,func_in_transaction_def} | {}
|
|
||||||
role | {postgres} | {}
|
|
||||||
schema | {fooschema} | {}
|
|
||||||
schema | {new_schema} | {}
|
|
||||||
schema | {post_11_upgrade} | {}
|
|
||||||
schema | {public} | {}
|
|
||||||
sequence | {post_11_upgrade,SC1} | {}
|
|
||||||
sequence | {post_11_upgrade,seq_bigint} | {}
|
|
||||||
sequence | {post_11_upgrade,unrelated_sequence} | {}
|
|
||||||
table | {fooschema,footable} | {}
|
|
||||||
table | {new_schema,another_dist_table} | {}
|
|
||||||
table | {post_11_upgrade,colocated_dist_table} | {}
|
|
||||||
table | {post_11_upgrade,colocated_partitioned_table} | {}
|
|
||||||
table | {post_11_upgrade,colocated_partitioned_table_2020_01_01} | {}
|
|
||||||
table | {post_11_upgrade,dist} | {}
|
|
||||||
table | {post_11_upgrade,employees} | {}
|
|
||||||
table | {post_11_upgrade,index_backed_rep_identity} | {}
|
|
||||||
table | {post_11_upgrade,part_table} | {}
|
|
||||||
table | {post_11_upgrade,part_table_p202008} | {}
|
|
||||||
table | {post_11_upgrade,part_table_p202009} | {}
|
|
||||||
table | {post_11_upgrade,reference_table} | {}
|
|
||||||
table | {post_11_upgrade,sensors} | {}
|
|
||||||
table | {post_11_upgrade,sensors_2020_01_01} | {}
|
|
||||||
table | {post_11_upgrade,sensors_news} | {}
|
|
||||||
table | {post_11_upgrade,sensors_old} | {}
|
|
||||||
table | {post_11_upgrade,sensors_parser} | {}
|
|
||||||
table | {post_11_upgrade,sensors_parser_a_partition} | {}
|
|
||||||
table | {post_11_upgrade,test} | {}
|
|
||||||
table | {post_11_upgrade,test_propagate_collate} | {}
|
|
||||||
table | {public,dist_table} | {}
|
|
||||||
text search configuration | {post_11_upgrade,partial_index_test_config} | {}
|
|
||||||
type | {fooschema.footype} | {}
|
|
||||||
type | {post_11_upgrade.my_type} | {}
|
|
||||||
type | {post_11_upgrade.my_type_for_view} | {}
|
|
||||||
view | {post_11_upgrade,depends_on_citus} | {}
|
|
||||||
view | {post_11_upgrade,depends_on_nothing_1} | {}
|
|
||||||
view | {post_11_upgrade,depends_on_nothing_2} | {}
|
|
||||||
view | {post_11_upgrade,depends_on_pg} | {}
|
|
||||||
view | {post_11_upgrade,depends_on_seq} | {}
|
|
||||||
view | {post_11_upgrade,non_dist_upgrade_multiple_dist_view} | {}
|
|
||||||
view | {post_11_upgrade,non_dist_upgrade_ref_view} | {}
|
|
||||||
view | {post_11_upgrade,non_dist_upgrade_ref_view_2} | {}
|
|
||||||
view | {post_11_upgrade,reporting_line} | {}
|
|
||||||
view | {post_11_upgrade,view_for_upgrade_test} | {}
|
|
||||||
view | {post_11_upgrade,view_for_upgrade_test_my_type} | {}
|
|
||||||
(48 rows)
|
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
-- run this test only when old citus version is earlier than 10.0
|
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 10
|
|
||||||
AS upgrade_test_old_citus_version_lt_10_0;
|
|
||||||
upgrade_test_old_citus_version_lt_10_0
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
t
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_lt_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
||||||
\endif
|
|
||||||
-- drop objects from previous test (uprade_basic_after.sql) for a clean test
|
|
||||||
-- drop upgrade_basic schema and switch back to public schema
|
|
||||||
SET search_path to public;
|
|
||||||
DROP SCHEMA upgrade_basic CASCADE;
|
|
||||||
NOTICE: drop cascades to 7 other objects
|
|
||||||
DETAIL: drop cascades to table upgrade_basic.t
|
|
||||||
drop cascades to table upgrade_basic.tp
|
|
||||||
drop cascades to table upgrade_basic.t_ab
|
|
||||||
drop cascades to table upgrade_basic.t2
|
|
||||||
drop cascades to table upgrade_basic.r
|
|
||||||
drop cascades to table upgrade_basic.tr
|
|
||||||
drop cascades to table upgrade_basic.t_range
|
|
||||||
-- as we updated citus to available version,
|
|
||||||
-- "isn" extension
|
|
||||||
-- "new_schema" schema
|
|
||||||
-- "public" schema
|
|
||||||
-- "fooschema" schema
|
|
||||||
-- "footype" type (under schema 'fooschema')
|
|
||||||
-- will now be marked as distributed
|
|
||||||
-- but,
|
|
||||||
-- "seg" extension
|
|
||||||
-- will not be marked as distributed
|
|
||||||
-- see underlying objects
|
|
||||||
SELECT i.* FROM pg_catalog.pg_dist_object, pg_identify_object_as_address(classid, objid, objsubid) i ORDER BY 1, 2, 3;
|
|
||||||
type | object_names | object_args
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
database | {postgres} | {}
|
|
||||||
role | {postgres} | {}
|
|
||||||
schema | {fooschema} | {}
|
|
||||||
schema | {new_schema} | {}
|
|
||||||
schema | {public} | {}
|
|
||||||
table | {fooschema,footable} | {}
|
|
||||||
table | {new_schema,another_dist_table} | {}
|
|
||||||
table | {public,dist_table} | {}
|
|
||||||
type | {fooschema.footype} | {}
|
|
||||||
(9 rows)
|
|
||||||
|
|
|
@ -1,46 +0,0 @@
|
||||||
-- run this test only when old citus version is earlier than 10.0
|
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 10
|
|
||||||
AS upgrade_test_old_citus_version_lt_10_0;
|
|
||||||
upgrade_test_old_citus_version_lt_10_0
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
t
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_lt_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
||||||
\endif
|
|
||||||
-- schema propagation --
|
|
||||||
-- public schema
|
|
||||||
CREATE TABLE dist_table (a int);
|
|
||||||
SELECT create_reference_table('dist_table');
|
|
||||||
create_reference_table
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
-- custom schema
|
|
||||||
CREATE SCHEMA new_schema;
|
|
||||||
SET search_path to new_schema;
|
|
||||||
CREATE TABLE another_dist_table (a int);
|
|
||||||
SELECT create_reference_table('another_dist_table');
|
|
||||||
create_reference_table
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
-- another custom schema and a type
|
|
||||||
-- create table that depends both on a type & schema here (actually type depends on the schema)
|
|
||||||
-- here we test if schema is marked as distributed successfully.
|
|
||||||
-- This is because tracking the dependencies will hit to the schema for two times
|
|
||||||
CREATE SCHEMA fooschema;
|
|
||||||
CREATE TYPE fooschema.footype AS (x int, y int);
|
|
||||||
CREATE TABLE fooschema.footable (f fooschema.footype);
|
|
||||||
SELECT create_reference_table('fooschema.footable');
|
|
||||||
create_reference_table
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
-- run this test only when old citus version is earlier than 10.0
|
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 10
|
|
||||||
AS upgrade_test_old_citus_version_lt_10_0;
|
|
||||||
upgrade_test_old_citus_version_lt_10_0
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
f
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_lt_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
-- run this test only when old citus version is earlier than 11.0
|
||||||
|
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
||||||
|
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 11
|
||||||
|
AS upgrade_test_old_citus_version_lt_11_0;
|
||||||
|
upgrade_test_old_citus_version_lt_11_0
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
\gset
|
||||||
|
\if :upgrade_test_old_citus_version_lt_11_0
|
||||||
|
\else
|
||||||
|
\q
|
||||||
|
\endif
|
||||||
SET search_path = post_11_upgrade;
|
SET search_path = post_11_upgrade;
|
||||||
-- tables, views and their dependencies become objects with Citus 11+
|
-- tables, views and their dependencies become objects with Citus 11+
|
||||||
SELECT pg_identify_object_as_address(classid, objid, objsubid) FROM pg_catalog.pg_dist_object WHERE objid IN ('post_11_upgrade'::regnamespace, 'post_11_upgrade.part_table'::regclass, 'post_11_upgrade.sensors'::regclass, 'post_11_upgrade.func_in_transaction_def'::regproc, 'post_11_upgrade.partial_index_test_config'::regconfig, 'post_11_upgrade.my_type'::regtype, 'post_11_upgrade.employees'::regclass, 'post_11_upgrade.view_for_upgrade_test'::regclass, 'post_11_upgrade.my_type_for_view'::regtype, 'post_11_upgrade.view_for_upgrade_test_my_type'::regclass, 'post_11_upgrade.non_dist_table_for_view'::regclass, 'post_11_upgrade.non_dist_upgrade_test_view'::regclass, 'post_11_upgrade.non_dist_upgrade_test_view_local_join'::regclass, 'post_11_upgrade.non_dist_upgrade_multiple_dist_view'::regclass, 'post_11_upgrade.non_dist_upgrade_ref_view'::regclass, 'post_11_upgrade.non_dist_upgrade_ref_view_2'::regclass, 'post_11_upgrade.reporting_line'::regclass, 'post_11_upgrade.v_test_1'::regclass, 'post_11_upgrade.v_test_2'::regclass, 'post_11_upgrade.owned_by_extension_table'::regclass, 'post_11_upgrade.materialized_view'::regclass, 'post_11_upgrade.owned_by_extension_view'::regclass, 'post_11_upgrade.local_type'::regtype, 'post_11_upgrade.non_dist_dist_table_for_view'::regclass, 'post_11_upgrade.depends_on_nothing_1'::regclass, 'post_11_upgrade.depends_on_nothing_2'::regclass, 'post_11_upgrade.depends_on_pg'::regclass, 'post_11_upgrade.depends_on_citus'::regclass, 'post_11_upgrade.depends_on_seq'::regclass, 'post_11_upgrade.depends_on_seq_and_no_support'::regclass) ORDER BY 1;
|
SELECT pg_identify_object_as_address(classid, objid, objsubid) FROM pg_catalog.pg_dist_object WHERE objid IN ('post_11_upgrade'::regnamespace, 'post_11_upgrade.part_table'::regclass, 'post_11_upgrade.sensors'::regclass, 'post_11_upgrade.func_in_transaction_def'::regproc, 'post_11_upgrade.partial_index_test_config'::regconfig, 'post_11_upgrade.my_type'::regtype, 'post_11_upgrade.employees'::regclass, 'post_11_upgrade.view_for_upgrade_test'::regclass, 'post_11_upgrade.my_type_for_view'::regtype, 'post_11_upgrade.view_for_upgrade_test_my_type'::regclass, 'post_11_upgrade.non_dist_table_for_view'::regclass, 'post_11_upgrade.non_dist_upgrade_test_view'::regclass, 'post_11_upgrade.non_dist_upgrade_test_view_local_join'::regclass, 'post_11_upgrade.non_dist_upgrade_multiple_dist_view'::regclass, 'post_11_upgrade.non_dist_upgrade_ref_view'::regclass, 'post_11_upgrade.non_dist_upgrade_ref_view_2'::regclass, 'post_11_upgrade.reporting_line'::regclass, 'post_11_upgrade.v_test_1'::regclass, 'post_11_upgrade.v_test_2'::regclass, 'post_11_upgrade.owned_by_extension_table'::regclass, 'post_11_upgrade.materialized_view'::regclass, 'post_11_upgrade.owned_by_extension_view'::regclass, 'post_11_upgrade.local_type'::regtype, 'post_11_upgrade.non_dist_dist_table_for_view'::regclass, 'post_11_upgrade.depends_on_nothing_1'::regclass, 'post_11_upgrade.depends_on_nothing_2'::regclass, 'post_11_upgrade.depends_on_pg'::regclass, 'post_11_upgrade.depends_on_citus'::regclass, 'post_11_upgrade.depends_on_seq'::regclass, 'post_11_upgrade.depends_on_seq_and_no_support'::regclass) ORDER BY 1;
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
-- run this test only when old citus version is earlier than 10.0
|
-- run this test only when old citus version is earlier than 11.0
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 10
|
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 11
|
||||||
AS upgrade_test_old_citus_version_lt_10_0;
|
AS upgrade_test_old_citus_version_lt_11_0;
|
||||||
upgrade_test_old_citus_version_lt_10_0
|
upgrade_test_old_citus_version_lt_11_0
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
f
|
f
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
\gset
|
\gset
|
||||||
\if :upgrade_test_old_citus_version_lt_10_0
|
\if :upgrade_test_old_citus_version_lt_11_0
|
||||||
\else
|
\else
|
||||||
\q
|
\q
|
|
@ -1,3 +1,17 @@
|
||||||
|
-- run this test only when old citus version is earlier than 11.0
|
||||||
|
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
||||||
|
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 11
|
||||||
|
AS upgrade_test_old_citus_version_lt_11_0;
|
||||||
|
upgrade_test_old_citus_version_lt_11_0
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
\gset
|
||||||
|
\if :upgrade_test_old_citus_version_lt_11_0
|
||||||
|
\else
|
||||||
|
\q
|
||||||
|
\endif
|
||||||
-- test cases for #3970
|
-- test cases for #3970
|
||||||
SET citus.shard_count TO 32;
|
SET citus.shard_count TO 32;
|
||||||
SET citus.shard_replication_factor TO 1;
|
SET citus.shard_replication_factor TO 1;
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
-- run this test only when old citus version is earlier than 10.0
|
-- run this test only when old citus version is earlier than 11.0
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 10
|
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 11
|
||||||
AS upgrade_test_old_citus_version_lt_10_0;
|
AS upgrade_test_old_citus_version_lt_11_0;
|
||||||
upgrade_test_old_citus_version_lt_10_0
|
upgrade_test_old_citus_version_lt_11_0
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
f
|
f
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
\gset
|
\gset
|
||||||
\if :upgrade_test_old_citus_version_lt_10_0
|
\if :upgrade_test_old_citus_version_lt_11_0
|
||||||
\else
|
\else
|
||||||
\q
|
\q
|
|
@ -1,2 +1 @@
|
||||||
test: upgrade_basic_after
|
test: upgrade_basic_after
|
||||||
test: upgrade_pg_dist_object_test_after
|
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
test: upgrade_basic_before
|
test: upgrade_basic_before
|
||||||
test: upgrade_pg_dist_object_test_before
|
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
-- Citus upgrades are finished by calling a procedure
|
-- Citus upgrades are finished by calling a procedure
|
||||||
|
|
||||||
|
-- Note that pg_catalog.citus_finish_citus_upgrade() behaves differently
|
||||||
|
-- when last upgrade citus version is less than 11
|
||||||
|
-- so we have two alternative outputs for this test
|
||||||
|
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
||||||
|
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 11
|
||||||
|
AS upgrade_test_old_citus_version_lt_11_0;
|
||||||
|
|
||||||
-- this is a transactional procedure, so rollback should be fine
|
-- this is a transactional procedure, so rollback should be fine
|
||||||
BEGIN;
|
BEGIN;
|
||||||
CALL citus_finish_citus_upgrade();
|
CALL citus_finish_citus_upgrade();
|
||||||
|
|
|
@ -1,78 +0,0 @@
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int >= 10 AND
|
|
||||||
substring(:'upgrade_test_old_citus_version', 'v\d+\.(\d+)\.\d+')::int >= 0
|
|
||||||
AS upgrade_test_old_citus_version_ge_10_0;
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_ge_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
||||||
\endif
|
|
||||||
|
|
||||||
-- it's not the best practice to define this here, but we don't want to include
|
|
||||||
-- columnar_test_helpers in upgrade test schedule
|
|
||||||
CREATE OR REPLACE FUNCTION columnar_storage_info(
|
|
||||||
rel regclass,
|
|
||||||
version_major OUT int4,
|
|
||||||
version_minor OUT int4,
|
|
||||||
storage_id OUT int8,
|
|
||||||
reserved_stripe_id OUT int8,
|
|
||||||
reserved_row_number OUT int8,
|
|
||||||
reserved_offset OUT int8)
|
|
||||||
STRICT
|
|
||||||
LANGUAGE c AS 'citus', 'columnar_storage_info';
|
|
||||||
|
|
||||||
CREATE VIEW columnar_table_stripe_info AS
|
|
||||||
SELECT columnar_table_storageids.relname relname,
|
|
||||||
columnar.stripe.stripe_num stripe_num,
|
|
||||||
columnar.stripe.row_count row_count,
|
|
||||||
columnar.stripe.first_row_number first_row_number
|
|
||||||
FROM columnar.stripe,
|
|
||||||
(
|
|
||||||
SELECT c.oid relid, c.relname relname, (columnar_storage_info(c.oid)).storage_id relstorageid
|
|
||||||
FROM pg_class c, pg_am a
|
|
||||||
WHERE c.relam = a.oid AND amname = 'columnar'
|
|
||||||
) columnar_table_storageids
|
|
||||||
WHERE relstorageid = columnar.stripe.storage_id;
|
|
||||||
|
|
||||||
SET search_path TO upgrade_columnar_metapage, public;
|
|
||||||
|
|
||||||
-- show that first_row_number values are equal to MAX(row_count) * stripe_num + COLUMNAR_FIRST_ROW_NUMBER
|
|
||||||
SELECT * FROM columnar_table_stripe_info ORDER BY relname, stripe_num;
|
|
||||||
|
|
||||||
-- should work since we upgrade metapages when upgrading schema version
|
|
||||||
INSERT INTO columnar_table_1 VALUES (3);
|
|
||||||
|
|
||||||
-- state of stripe metadata for columnar_table_1 after post-upgrade insert
|
|
||||||
SELECT * FROM columnar_table_stripe_info WHERE relname = 'columnar_table_1' ORDER BY stripe_num;
|
|
||||||
|
|
||||||
-- show that all columnar relation's metapage's are upgraded to "2.0"
|
|
||||||
SELECT count(*)=0
|
|
||||||
FROM (SELECT (columnar_storage_info(c.oid)).* t
|
|
||||||
FROM pg_class c, pg_am a
|
|
||||||
WHERE c.relam = a.oid AND amname = 'columnar') t
|
|
||||||
WHERE t.version_major != 2 and t.version_minor != 0;
|
|
||||||
|
|
||||||
-- print metapage for two of the tables
|
|
||||||
SELECT version_major, version_minor, reserved_stripe_id, reserved_row_number
|
|
||||||
FROM columnar_storage_info('columnar_table_1');
|
|
||||||
SELECT version_major, version_minor, reserved_stripe_id, reserved_row_number
|
|
||||||
FROM columnar_storage_info('columnar_table_2');
|
|
||||||
|
|
||||||
-- show that no_data_columnar_table also has metapage after upgrade
|
|
||||||
SELECT version_major, version_minor, reserved_stripe_id, reserved_row_number
|
|
||||||
FROM columnar_storage_info('no_data_columnar_table');
|
|
||||||
|
|
||||||
-- table is already upgraded, make sure that upgrade_columnar_metapage is no-op
|
|
||||||
SELECT columnar_internal.upgrade_columnar_storage(c.oid)
|
|
||||||
FROM pg_class c, pg_am a
|
|
||||||
WHERE c.relam = a.oid AND amname = 'columnar' and relname = 'columnar_table_2';
|
|
||||||
|
|
||||||
SELECT version_major, version_minor, reserved_stripe_id, reserved_row_number
|
|
||||||
FROM columnar_storage_info('columnar_table_2');
|
|
||||||
|
|
||||||
VACUUM FULL columnar_table_2;
|
|
||||||
|
|
||||||
-- print metapage and stripe metadata after post-upgrade vacuum full
|
|
||||||
SELECT version_major, version_minor, reserved_stripe_id, reserved_row_number
|
|
||||||
FROM columnar_storage_info('columnar_table_2');
|
|
||||||
SELECT * FROM columnar_table_stripe_info WHERE relname = 'columnar_table_2' ORDER BY stripe_num;
|
|
|
@ -1,26 +0,0 @@
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int >= 10 AND
|
|
||||||
substring(:'upgrade_test_old_citus_version', 'v\d+\.(\d+)\.\d+')::int >= 0
|
|
||||||
AS upgrade_test_old_citus_version_ge_10_0;
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_ge_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
||||||
\endif
|
|
||||||
|
|
||||||
CREATE SCHEMA upgrade_columnar_metapage;
|
|
||||||
SET search_path TO upgrade_columnar_metapage, public;
|
|
||||||
|
|
||||||
CREATE TABLE columnar_table_1(a INT, b INT) USING columnar;
|
|
||||||
INSERT INTO columnar_table_1 SELECT i FROM generate_series(160001, 320000) i;
|
|
||||||
|
|
||||||
CREATE TABLE columnar_table_2(b INT) USING columnar;
|
|
||||||
SELECT alter_columnar_table_set('columnar_table_2',
|
|
||||||
chunk_group_row_limit => 1000,
|
|
||||||
stripe_row_limit => 1000);
|
|
||||||
INSERT INTO columnar_table_2 SELECT i FROM generate_series(1600, 3500) i;
|
|
||||||
|
|
||||||
CREATE TABLE columnar_table_3(b INT) USING columnar;
|
|
||||||
INSERT INTO columnar_table_3 VALUES (1), (2);
|
|
||||||
|
|
||||||
CREATE TABLE no_data_columnar_table(a INT, b INT, c TEXT) USING columnar;
|
|
|
@ -1,25 +0,0 @@
|
||||||
-- run this test only when old citus version is earlier than 10.0
|
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 10
|
|
||||||
AS upgrade_test_old_citus_version_lt_10_0;
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_lt_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
||||||
\endif
|
|
||||||
|
|
||||||
-- test cases for #3970
|
|
||||||
SET search_path = test_3970;
|
|
||||||
|
|
||||||
--5. add a partition
|
|
||||||
-- This command will fail as the child table has a wrong constraint name
|
|
||||||
CREATE TABLE part_table_p202009 PARTITION OF part_table FOR VALUES FROM ('2020-09-01 00:00:00') TO ('2020-10-01 00:00:00');
|
|
||||||
|
|
||||||
-- fix constraint names on partitioned table shards
|
|
||||||
SELECT fix_pre_citus10_partitioned_table_constraint_names('part_table'::regclass);
|
|
||||||
|
|
||||||
--5. add a partition
|
|
||||||
CREATE TABLE part_table_p202009 PARTITION OF part_table FOR VALUES FROM ('2020-09-01 00:00:00') TO ('2020-10-01 00:00:00');
|
|
||||||
|
|
||||||
RESET search_path;
|
|
||||||
DROP SCHEMA test_3970 CASCADE;
|
|
|
@ -1,39 +0,0 @@
|
||||||
-- run this test only when old citus version is earlier than 10.0
|
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 10
|
|
||||||
AS upgrade_test_old_citus_version_lt_10_0;
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_lt_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
||||||
\endif
|
|
||||||
|
|
||||||
-- test cases for #3970
|
|
||||||
CREATE SCHEMA test_3970;
|
|
||||||
SET search_path = test_3970;
|
|
||||||
|
|
||||||
--1. create a partitioned table
|
|
||||||
CREATE TABLE part_table (
|
|
||||||
work_ymdt timestamp without time zone NOT NULL,
|
|
||||||
seq bigint NOT NULL,
|
|
||||||
my_seq bigint NOT NULL,
|
|
||||||
work_memo character varying(150),
|
|
||||||
CONSTRAINT work_memo_check CHECK ((octet_length((work_memo)::text) <= 150))
|
|
||||||
)
|
|
||||||
PARTITION BY RANGE (work_ymdt);
|
|
||||||
|
|
||||||
--2. perform create_distributed_table
|
|
||||||
SELECT create_distributed_table('part_table', 'seq');
|
|
||||||
|
|
||||||
--3. add a partition
|
|
||||||
CREATE TABLE part_table_p202008 PARTITION OF part_table FOR VALUES FROM ('2020-08-01 00:00:00') TO ('2020-09-01 00:00:00');
|
|
||||||
|
|
||||||
--4. add a check constraint
|
|
||||||
ALTER TABLE part_table ADD CONSTRAINT my_seq CHECK (my_seq > 0);
|
|
||||||
|
|
||||||
--5. add a partition
|
|
||||||
-- This command will fail as the child table has a wrong constraint name
|
|
||||||
CREATE TABLE part_table_p202009 PARTITION OF part_table FOR VALUES FROM ('2020-09-01 00:00:00') TO ('2020-10-01 00:00:00');
|
|
||||||
|
|
||||||
-- Add another constraint with a long name that will get truncated with a hash
|
|
||||||
ALTER TABLE part_table ADD CONSTRAINT ck_012345678901234567890123456789012345678901234567890123456789 CHECK (my_seq > 0);
|
|
|
@ -1,28 +0,0 @@
|
||||||
-- run this test only when old citus version is earlier than 10.0
|
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 10
|
|
||||||
AS upgrade_test_old_citus_version_lt_10_0;
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_lt_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
||||||
\endif
|
|
||||||
|
|
||||||
-- drop objects from previous test (uprade_basic_after.sql) for a clean test
|
|
||||||
-- drop upgrade_basic schema and switch back to public schema
|
|
||||||
SET search_path to public;
|
|
||||||
DROP SCHEMA upgrade_basic CASCADE;
|
|
||||||
|
|
||||||
-- as we updated citus to available version,
|
|
||||||
-- "isn" extension
|
|
||||||
-- "new_schema" schema
|
|
||||||
-- "public" schema
|
|
||||||
-- "fooschema" schema
|
|
||||||
-- "footype" type (under schema 'fooschema')
|
|
||||||
-- will now be marked as distributed
|
|
||||||
-- but,
|
|
||||||
-- "seg" extension
|
|
||||||
-- will not be marked as distributed
|
|
||||||
|
|
||||||
-- see underlying objects
|
|
||||||
SELECT i.* FROM pg_catalog.pg_dist_object, pg_identify_object_as_address(classid, objid, objsubid) i ORDER BY 1, 2, 3;
|
|
|
@ -1,35 +0,0 @@
|
||||||
-- run this test only when old citus version is earlier than 10.0
|
|
||||||
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
|
||||||
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 10
|
|
||||||
AS upgrade_test_old_citus_version_lt_10_0;
|
|
||||||
\gset
|
|
||||||
\if :upgrade_test_old_citus_version_lt_10_0
|
|
||||||
\else
|
|
||||||
\q
|
|
||||||
\endif
|
|
||||||
|
|
||||||
-- schema propagation --
|
|
||||||
|
|
||||||
-- public schema
|
|
||||||
CREATE TABLE dist_table (a int);
|
|
||||||
SELECT create_reference_table('dist_table');
|
|
||||||
|
|
||||||
-- custom schema
|
|
||||||
CREATE SCHEMA new_schema;
|
|
||||||
|
|
||||||
SET search_path to new_schema;
|
|
||||||
|
|
||||||
CREATE TABLE another_dist_table (a int);
|
|
||||||
SELECT create_reference_table('another_dist_table');
|
|
||||||
|
|
||||||
-- another custom schema and a type
|
|
||||||
|
|
||||||
-- create table that depends both on a type & schema here (actually type depends on the schema)
|
|
||||||
-- here we test if schema is marked as distributed successfully.
|
|
||||||
-- This is because tracking the dependencies will hit to the schema for two times
|
|
||||||
|
|
||||||
CREATE SCHEMA fooschema;
|
|
||||||
CREATE TYPE fooschema.footype AS (x int, y int);
|
|
||||||
|
|
||||||
CREATE TABLE fooschema.footable (f fooschema.footype);
|
|
||||||
SELECT create_reference_table('fooschema.footable');
|
|
|
@ -1,3 +1,13 @@
|
||||||
|
-- run this test only when old citus version is earlier than 11.0
|
||||||
|
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
||||||
|
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 11
|
||||||
|
AS upgrade_test_old_citus_version_lt_11_0;
|
||||||
|
\gset
|
||||||
|
\if :upgrade_test_old_citus_version_lt_11_0
|
||||||
|
\else
|
||||||
|
\q
|
||||||
|
\endif
|
||||||
|
|
||||||
SET search_path = post_11_upgrade;
|
SET search_path = post_11_upgrade;
|
||||||
|
|
||||||
-- tables, views and their dependencies become objects with Citus 11+
|
-- tables, views and their dependencies become objects with Citus 11+
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
-- run this test only when old citus version is earlier than 11.0
|
||||||
|
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
|
||||||
|
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 11
|
||||||
|
AS upgrade_test_old_citus_version_lt_11_0;
|
||||||
|
\gset
|
||||||
|
\if :upgrade_test_old_citus_version_lt_11_0
|
||||||
|
\else
|
||||||
|
\q
|
||||||
|
\endif
|
||||||
|
|
||||||
-- test cases for #3970
|
-- test cases for #3970
|
||||||
SET citus.shard_count TO 32;
|
SET citus.shard_count TO 32;
|
||||||
|
|
Loading…
Reference in New Issue