I have a similar issue when converting from a non partition to a partition table.
CREATE TABLE test (
arch_date date NOT NULL,
alert_key int4 NOT NULL
);
INSERT INTO test (arch_date,alert_key) VALUES
('2024-06-01',40092),
('2024-06-01',70018),
('2024-07-01',70043);
DBD::Pg::db do failed: ERROR: new row for relation "test_p20240601" violates partition constraint
DETAIL: Failing row contains (2024-07-01, 70043.
CONTEXT: SQL statement "WITH partition_data AS (
DELETE FROM ONLY test WHERE arch_date::text >= '2024-06-01 00:00:00+02' AND arch_date::text < '2024-07-01 00:00:00+02' RETURNING *)
INSERT INTO ....
2024-07-01 -> seems to be smaller then < '2024-07-01 00:00:00+02'
Originally posted by @clausgeert in #838
Originally posted by @clausgeert in #838