-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Safe to rename a partitioned table #747
Comments
I think you've covered everything there. Also make sure to update the template table name in the part_config table as well. This document was my attempt at a process to convert an existing partition set to partman so hopefully it helps https://github.com/pgpartman/pg_partman/blob/development/doc/migrate_to_partman.md |
Thanks for the confirmation. If I understand this correctly renaming contraints and partitions isn't necessary but is just good practice to keep everything clean. The only thing that needs to change is parent_name in the part_config, the name of the template table, and the column that references that table in part_config. If this data is wrong the partition manager will fail to create new partitions when maintenace is run. |
I believe that's correct. Would still recommend testing first just to be sure. |
I made the changes listed and tested by upating the premake parameter, running partition maintenance, and inserting a record into one of the newly created partitions. All appears well. Anything else to test? I'll close the issue if adequate. |
Nothing else I can think of. If anything comes up, please feel free to make an issue and I can look into it. |
I'm attempting to migrate an existing table to a native partitioned table managed by partman. Once the copy of the data from the existing table is complete I want to rename the partitioned table to the existing table. Is there any problem with renaming all the partitions, renaming the template table, and upating the row in part_config for the partitioned table to reflect the exising name? Any other concerns modifying the partman config tables in this manner?
The text was updated successfully, but these errors were encountered: