You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'd like to alter an existing table that is partitioned with pg_partman.create_parent() on update_time, by inserting a new column, insertion_time, and partitioning off of insertion_time. It looks like if I want to partition on a different column, I need to create a new table (please correct me if I'm wrong).
So I:
create all new things: a new table with insertion_time and a new template
partition on insertion_time with pg partman via create_parent()
migrate the data from the original table to the new table via INSERT INTO new table FROM original table
DROP TABLE IF EXISTS original_table CASCADE;drop table original_template
rename the foreign keys, rename the new table, rename new template to original names (in that order)
However, my partitioned child tables do not rename. How do I rename the partitioned tables new_table_name_p2025_02, etc to original_table_name_p2025_02 via pg_partman?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I'd like to alter an existing table that is partitioned with pg_partman.create_parent() on update_time, by inserting a new column, insertion_time, and partitioning off of insertion_time. It looks like if I want to partition on a different column, I need to create a new table (please correct me if I'm wrong).
So I:
DROP TABLE IF EXISTS original_table CASCADE;
drop table original_template
However, my partitioned child tables do not rename. How do I rename the partitioned tables new_table_name_p2025_02, etc to original_table_name_p2025_02 via pg_partman?
Beta Was this translation helpful? Give feedback.
All reactions