Replies: 4 comments
-
Yes, just update the Even if you're not able t update to version 5 of pg_partman yet, I would highly recommend updating to at least the latest 4 version. There have been quite a few bug fixes since 4.5.1 https://github.com/pgpartman/pg_partman/blob/master/CHANGELOG-pre-5.0.0.txt |
Beta Was this translation helpful? Give feedback.
-
Functions in PG are always atomic and executed as one single transaction. It's either all or nothing from when it's called to when it finishes and if there are any errors, it will be entirely rolled back. If you want individual statements to be committed, look into making it a PROCEDURE instead. |
Beta Was this translation helpful? Give feedback.
-
If you want some other ideas for doing object renames, see some of the migration docs. For example, I just have it generate the ALTER statements and then execute those separately https://github.com/pgpartman/pg_partman/blob/master/doc/migrate_to_partman.md#step-3a |
Beta Was this translation helpful? Give feedback.
-
I will make few logging changes and stick to the function to do all the job. We strictly take DDL changes via flyway, that too single source of truth for all zones. Thanks for your help @keithf4 :) |
Beta Was this translation helpful? Give feedback.
-
Postgres 13.10
partman extension version: 4.5.1
Scenario: Partitioning existing table with exact same schema. The original table only has inserts no updates or deletes
Steps:
After above steps partman.show_partitions throws exception [P0001] ERROR: Given parent table not managed by pg_partman:
Since part_config still has 'public.table_partitioned' as parent.
How to we handle this?
Simply renaming all partitions and parent table in part_config and template table name is enough?
One approach
Creating a template table manually in partman schema with name 'table'. That takes care of template table name but child tables still get created using parent table name.
Beta Was this translation helpful? Give feedback.
All reactions