Created
May 24, 2017 16:18
-
-
Save saicitus/e272ebcaeb504c8a657c06741e299874 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE test (x varchar, y int); | |
SELECT create_distributed_table('test', 'x'); | |
BEGIN; | |
SET LOCAL citus.enable_ddl_propagation TO off; | |
DELETE FROM pg_depend WHERE objid = 'test'::regclass AND objid = refobjid RETURNING *; | |
ALTER TABLE test ALTER COLUMN x TYPE text; | |
SELECT * FROM run_command_on_placements('test', 'ALTER TABLE %I ALTER COLUMN x TYPE text'); | |
UPDATE pg_dist_partition SET partkey = column_name_to_column('test', 'x') WHERE logicalrelid = 'test'::regclass; | |
COMMIT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment