mirror of https://github.com/citusdata/citus.git
Bump use of new sql function
parent
826ac1b099
commit
9a2227c70d
|
@ -1,6 +1,6 @@
|
||||||
# Citus extension
|
# Citus extension
|
||||||
comment = 'Citus distributed database'
|
comment = 'Citus distributed database'
|
||||||
default_version = '10.0-3'
|
default_version = '10.0-4'
|
||||||
module_pathname = '$libdir/citus'
|
module_pathname = '$libdir/citus'
|
||||||
relocatable = false
|
relocatable = false
|
||||||
schema = pg_catalog
|
schema = pg_catalog
|
||||||
|
|
|
@ -86,17 +86,7 @@ BEGIN
|
||||||
FROM pg_catalog.pg_dist_partition p;
|
FROM pg_catalog.pg_dist_partition p;
|
||||||
|
|
||||||
-- restore pg_dist_object from the stable identifiers
|
-- restore pg_dist_object from the stable identifiers
|
||||||
-- DELETE/INSERT to avoid primary key violations
|
TRUNCATE citus.pg_dist_object;
|
||||||
WITH old_records AS (
|
|
||||||
DELETE FROM
|
|
||||||
citus.pg_dist_object
|
|
||||||
RETURNING
|
|
||||||
type,
|
|
||||||
object_names,
|
|
||||||
object_args,
|
|
||||||
distribution_argument_index,
|
|
||||||
colocationid
|
|
||||||
)
|
|
||||||
INSERT INTO citus.pg_dist_object (classid, objid, objsubid, distribution_argument_index, colocationid)
|
INSERT INTO citus.pg_dist_object (classid, objid, objsubid, distribution_argument_index, colocationid)
|
||||||
SELECT
|
SELECT
|
||||||
address.classid,
|
address.classid,
|
||||||
|
@ -105,8 +95,10 @@ BEGIN
|
||||||
naming.distribution_argument_index,
|
naming.distribution_argument_index,
|
||||||
naming.colocationid
|
naming.colocationid
|
||||||
FROM
|
FROM
|
||||||
old_records naming,
|
public.pg_dist_object naming,
|
||||||
pg_get_object_address(naming.type, naming.object_names, naming.object_args) address;
|
pg_catalog.pg_get_object_address(naming.type, naming.object_names, naming.object_args) address;
|
||||||
|
|
||||||
|
DROP TABLE public.pg_dist_object;
|
||||||
|
|
||||||
PERFORM citus_internal.columnar_ensure_objects_exist();
|
PERFORM citus_internal.columnar_ensure_objects_exist();
|
||||||
END;
|
END;
|
||||||
|
|
|
@ -44,8 +44,14 @@ BEGIN
|
||||||
FROM pg_catalog.pg_dist_rebalance_strategy;
|
FROM pg_catalog.pg_dist_rebalance_strategy;
|
||||||
|
|
||||||
-- store upgrade stable identifiers on pg_dist_object catalog
|
-- store upgrade stable identifiers on pg_dist_object catalog
|
||||||
UPDATE citus.pg_dist_object
|
CREATE TABLE public.pg_dist_object AS SELECT
|
||||||
SET (type, object_names, object_args) = (SELECT * FROM pg_identify_object_as_address(classid, objid, objsubid));
|
address.type,
|
||||||
|
address.object_names,
|
||||||
|
address.object_args,
|
||||||
|
objects.distribution_argument_index,
|
||||||
|
objects.colocationid
|
||||||
|
FROM citus.pg_dist_object objects,
|
||||||
|
pg_catalog.pg_identify_object_as_address(objects.classid, objects.objid, objects.objsubid) address;
|
||||||
END;
|
END;
|
||||||
$cppu$;
|
$cppu$;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue