From: keithf4 (@keithf4) <noreply+keithf4@github.com>
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
Subject: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
Date: Thu, 12 Mar 2026 15:20:29 +0000
Message-ID: <gh-pgpartman-pg_partman-856@github.com> (raw)
> 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](https://github.com/pgpartman/pg_partman/issues/838#issuecomment-4037034722)_