pg.ddx.io  pgpartman/pg_partman GitHub issues and pull requests  
help / color / mirror / Atom feed
[pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
15+ messages / 3 participants
[nested] [flat]

* [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-03-12 15:20 "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  0 siblings, 0 replies; 15+ messages in thread

From: keithf4 (@keithf4) @ 2026-03-12 15:20 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

> 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)_

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-03-12 15:21 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: keithf4 (@keithf4) @ 2026-03-12 15:21 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 assigned @keithf4.

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-03-12 15:21 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: keithf4 (@keithf4) @ 2026-03-12 15:21 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 applied label "confirmed bug".

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-03-12 15:22 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: keithf4 (@keithf4) @ 2026-03-12 15:22 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 set milestone to "Next Patch".

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-03-17 05:58 ` "clausgeert (@clausgeert)" <noreply+clausgeert@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: clausgeert (@clausgeert) @ 2026-03-17 05:58 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 
Small question : Will this be solved with the patch of April ?

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-04-14 07:11 ` "clausgeert (@clausgeert)" <noreply+clausgeert@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: clausgeert (@clausgeert) @ 2026-04-14 07:11 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 Will this be solved with the patch of April ?

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-06-02 10:27 ` "achix (@achix)" <noreply+achix@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: achix (@achix) @ 2026-06-02 10:27 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

Hi I can verify I run into the same bug, or so I think : 

FreeBSD 15,  pgsql 18.3, partman from source 5.4.3 

dynacom=# \d tagsdata.tagsrawsentence_default
               Table "tagsdata.tagsrawsentence_default"
 Column |            Type             | Collation | Nullable | Default 
--------+-----------------------------+-----------+----------+---------
 utcts  | timestamp without time zone |           | not null | 
 tagid  | integer                     |           | not null | 
 value  | text                        |           | not null | 
Partition of: tagsdata.tagsrawsentence DEFAULT
Indexes:
    "tagsrawsentence_default_pkey" PRIMARY KEY, btree (utcts, tagid)
    "tagsrawsentence_default_tagid" btree (tagid)
    "tagsrawsentence_default_utcts" btree (utcts)
Tablespace: "ssd"

ERROR:  new row for relation "tagsrawsentence_p20260418" violates partition constraint
DETAIL:  Failing row contains (2026-04-19 00:00:00.349, 71683, 70.0,T).
CONTEXT:  SQL statement "WITH partition_data AS (
                DELETE FROM partman_temp_data_storage RETURNING *)
            INSERT INTO tagsdata.tagsrawsentence_p20260418 (utcts,tagid,value)   SELECT utcts,tagid,value FROM partition_data"
PL/pgSQL function partition_data_time(text,integer,interval,numeric,text,boolean,text,text[],boolean,boolean) line 335 at EXECUTE
SQL statement "SELECT partman.partition_data_time (p_parent_table := 'tagsdata.tagsrawsentence'
                                                , p_lock_wait := '0'
                                                , p_order := 'ASC'
                                                , p_analyze := false, p_ignore_infinity := 'f')"
PL/pgSQL function partman.partition_data_proc(text,integer,text,integer,integer,integer,text,text,text[],boolean,boolean) line 92 at EXECUTE

The way I solved it : 
 with foo as (delete from tagsdata.tagsrawsentence_default where utcts = '2026-04-19 00:00:00.349' and tagid = 71683 returning *)
select * into tagsrawsentence_damage from foo;
SELECT 1

with foo as (delete from tagsdata.tagsrawsentence_default where utcts = '2026-04-19 00:00:00.349' returning *)
insert into tagsrawsentence_damage select * from foo;
INSERT 0 8

Then partman.partition_data_proc('tagsdata.tagsrawsentence')  went smooth ,  then finally : 
insert into tagsdata.tagsrawsentence select * from tagsrawsentence_damage ;

I must also note that those 9 failing rows, were the only ones among the whole dataset ( 17,546,132 rows  ) that were just 349 milliseconds ahead of the start of the day .

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-10-26 18:24 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: keithf4 (@keithf4) @ 2026-10-26 18:24 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

I believe I have this fixed in the `551` branch for the upcoming 5.5.1 release if you'd like to test it out.

Apologies for the delay getting a fix up for this.

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-10-26 18:25 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: keithf4 (@keithf4) @ 2026-10-26 18:25 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 applied label "fixed in next release".

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-11-03 12:59 ` "clausgeert (@clausgeert)" <noreply+clausgeert@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: clausgeert (@clausgeert) @ 2026-11-03 12:59 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

I still have this issue in 

Name        : pg_partman_17
Version     : 5.5.0
Release     : 2PGDG.rhel9.8


^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-11-03 13:49 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: keithf4 (@keithf4) @ 2026-11-03 13:49 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

> 12\. I still have this issue in
>      Name        : pg_partman_17
>      Version     : 5.5.0
>      Release     : 2PGDG.rhel9.8

@clausgeert yes this issue still exists in 5.5.0. I believe I have a fix in the `551` branch if you'd like to test it out. You'll have to run `ALTER EXTENSION pg_partman ...` to install the new update file. Don't do this on production since it may not be the final version
 yet.

https://github.com/pgpartman/pg_partman/tree/551

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-11-19 10:20 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: keithf4 (@keithf4) @ 2026-11-19 10:20 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 removed milestone.

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-11-19 10:20 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: keithf4 (@keithf4) @ 2026-11-19 10:20 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 set milestone to "5.5".

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-11-19 10:21 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: keithf4 (@keithf4) @ 2026-11-19 10:21 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 applied label "fixed in current release".

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly
@ 2026-11-19 10:21 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: keithf4 (@keithf4) @ 2026-11-19 10:21 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 removed label "fixed in next release".

^ permalink  raw  [nested|flat] 15+ messages in thread


end of thread, other threads:[~2026-11-19 10:21 UTC | newest]

Thread overview: 15+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-03-12 15:20 [pgpartman/pg_partman] issue #856: partition_data processes not handling date data type properly "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-03-12 15:21 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-03-12 15:21 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-03-12 15:22 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-03-17 05:58 ` "clausgeert (@clausgeert)" <noreply+clausgeert@github.com>
2026-04-14 07:11 ` "clausgeert (@clausgeert)" <noreply+clausgeert@github.com>
2026-06-02 10:27 ` "achix (@achix)" <noreply+achix@github.com>
2026-10-26 18:24 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-10-26 18:25 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-03 12:59 ` "clausgeert (@clausgeert)" <noreply+clausgeert@github.com>
2026-11-03 13:49 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-19 10:20 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-19 10:20 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-19 10:21 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-19 10:21 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox