Too much data ingress for partman to succeed? #825
Replies: 2 comments 5 replies
-
|
This error means there is data in the default that would match data that would go into the new child table that it is trying to attach. So that means you are inserting data that does not yet have a child table for it. First thing would be to figure out what the window of time you expect your data ingestion to cover relative to the partition column's value. Once you know that, then set the "premake" value in "part_config" to stay ahead of your expected data ingestion window and make sure maintenance is running often enough to keep up with it. Note that partman partition creation is only for future data. If you're still getting data into the default for past data without child tables, then you'll have to manage migrating that out manually. The |
Beta Was this translation helpful? Give feedback.
-
|
If the data in the default is valid data, again the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm having issues lately, we run pg_partman on a table that ingresses around ~5k records every minute and this volume makes either
run_maintenance_procandpartition_data_procboth fail as, what i think, data gets inserted before pg_partman can finish its routine.This snippet is the error i get:
pq: updated partition constraint for default partition "redacted_default" would be violated by some row CONTEXT: SQL statement "ALTER TABLE public.redacted ATTACH PARTITION public.redacted_p20251104 FOR VALUES FROM ('2025-11-04 00:00:00+00') TO ('2025-11-05 00:00:00+00')" PL/pgSQL function create_partition_time(text,timestamp with time zone[],text) line 197 at EXECUTE PL/pgSQL function partition_data_time(text,integer,interval,numeric,text,boolean,text,text[]) line 243 at assignment SQL statement "SELECT public.partition_data_time (p_parent_table := 'public.redacted', p_lock_wait := '0', p_order := 'ASC', p_analyze := false)" PL/pgSQL function partition_data_proc(text,integer,text,integer,integer,integer,text,text,text[],boolean) line 86How do you handle these type of situations? Is there a golden standard i probably don't follow?
Love to hear back from any of you.
Beta Was this translation helpful? Give feedback.
All reactions