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
partman.run_maintenance job failed with below error. Because of this failure other table partition drop also didn't happened.
Can you please let me know the fix for this. partman version is 5
Name | Version | Schema | Description
--------------+---------+------------+--------------------------------------------------------------
pg_partman | 5.1.0 | partman | Extension to manage partitioned tables by time or ID
ERROR: cannot drop table order_header_p20241111 because other objects depend on it
CONTEXT: SQL statement "DROP TABLE "LOADTEST".order_header_p20241111"
PL/pgSQL function drop_partition_time(text,interval,boolean,boolean,text,timestamp with time zone) line 247 at EXECUTE
PL/pgSQL function partman.run_maintenance(text,boolean,boolean) line 195 at assignment
DETAIL: constraint order_line_header_fk on table order_line depends on table order_header_p20241111
constraint tender_fk on table tender_details depends on table order_header_p20241111
HINT: Use DROP ... CASCADE to drop the dependent objects too.
CONTEXT: PL/pgSQL function drop_partition_time(text,interval,boolean,boolean,text,timestamp with time zone) line 304 at RAISE
PL/pgSQL function partman.run_maintenance(text,boolean,boolean) line 195 at assignment
DETAIL:
HINT:
CONTEXT: PL/pgSQL function partman.run_maintenance(text,boolean,boolean) line 437 at RAISE
The text was updated successfully, but these errors were encountered:
Do you have foreign keys coming in to this partition set? If so, it sounds like it's trying to drop a child table that has data that the other table referencing it needs.
pg_partman does not have the option to DROP CASCADE because if you do that, the entire foreign key reference to the entire partition set is dropped, not just the child table that is being removed. It's a bug that I believe has been reported to core, but I haven't heard any more on it
The solution would be to ensure that the data that exist in the child table that is being dropped has been deleted in the other table before the maintenance to remove that child table is run.
If this is not the case, please clarify the FK relationships to and from this partition set.
Hi Keith,
partman.run_maintenance job failed with below error. Because of this failure other table partition drop also didn't happened.
Can you please let me know the fix for this. partman version is 5
--------------+---------+------------+--------------------------------------------------------------
pg_partman | 5.1.0 | partman | Extension to manage partitioned tables by time or ID
SELECT partman.run_maintenance('LOADTEST.order_header');
ERROR: cannot drop table order_header_p20241111 because other objects depend on it
CONTEXT: SQL statement "DROP TABLE "LOADTEST".order_header_p20241111"
PL/pgSQL function drop_partition_time(text,interval,boolean,boolean,text,timestamp with time zone) line 247 at EXECUTE
PL/pgSQL function partman.run_maintenance(text,boolean,boolean) line 195 at assignment
DETAIL: constraint order_line_header_fk on table order_line depends on table order_header_p20241111
constraint tender_fk on table tender_details depends on table order_header_p20241111
HINT: Use DROP ... CASCADE to drop the dependent objects too.
CONTEXT: PL/pgSQL function drop_partition_time(text,interval,boolean,boolean,text,timestamp with time zone) line 304 at RAISE
PL/pgSQL function partman.run_maintenance(text,boolean,boolean) line 195 at assignment
DETAIL:
HINT:
CONTEXT: PL/pgSQL function partman.run_maintenance(text,boolean,boolean) line 437 at RAISE
The text was updated successfully, but these errors were encountered: