pg.ddx.io  pgpartman/pg_partman GitHub issues and pull requests  
help / color / mirror / Atom feed
From: jakubmalek (@jakubmalek) <noreply+jakubmalek@github.com>
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
Subject: [pgpartman/pg_partman] issue #870: Error while creating nested partition with pg_partman
Date: Thu, 25 Jun 2026 13:19:01 +0000
Message-ID: <gh-pgpartman-pg_partman-870@github.com> (raw)

With latest `5.4.3` version pg_partman, I'm unable to create range partition for child-partition table.

Here is an example of the initial setup:
```sql
CREATE TYPE retention_tier AS ENUM (
  'standard',
  'extended'
);

CREATE TABLE IF NOT EXISTS events (
    id BIGSERIAL NOT NULL,
    retention_tier retention_tier NOT NULL,
    event_time TIMESTAMPTZ NOT NULL,
    data JSONB NOT NULL
) PARTITION BY LIST (retention_tier);

CREATE TABLE events_standard PARTITION OF events
    FOR VALUES IN ('standard')
    PARTITION BY RANGE (event_time);
CREATE TABLE events_extended PARTITION OF events
    FOR VALUES IN ('extended')
    PARTITION BY RANGE (event_time);
```

Then when I try to create partition for `events_standard` table:

```sql
SELECT create_partition(
    p_parent_table => 'public.events_standard',
    p_control => 'event_time',
    p_interval=> '1 day',
    p_type => 'range',
    p_premake => 3,
    p_constraint_cols => ARRAY['id']);
```

I get following error:

```
ERROR:  invalid input syntax for type timestamp with time zone: "'standard'"
CONTEXT: PL/pgSQL function show_partition_info(text,text,text,boolean) line 130 at assignment
SQL statement "SELECT child_start_time::text, child_end_time::text
                                      FROM public.show_partition_info(p_parent_table, v_top_interval, v_top_schema||'.'||v_top_tablename)"
PL/pgSQL function check_subpartition_limits(text,text) line 52 at SQL statement
SQL statement "SELECT sub_min::timestamptz, sub_max::timestamptz                                               FROM public.check_subpartition_limits(p_parent_table, 'time')"
PL/pgSQL function create_partition_time(text,timestamp with time zone[],text) line 105 at SQL statement
PL/pgSQL function create_partition(text,text,text,text,text,integer,text,boolean,text,text[],text,boolean,text,boolean,text,text,bigint) line 383 at assignment
DETAIL:
HINT:
CONTEXT: PL/pgSQL function create_partition_time(text,timestamp with time zone[],text) line 401 at RAISE
PL/pgSQL function create_partition(text,text,text,text,text,integer,text,boolean,text,text[],text,boolean,text,boolean,text,text,bigint) line 383 at assignment
DETAIL:
HINT:
CONTEXT:  PL/pgSQL function create_partition(text,text,text,text,text,integer,text,boolean,text,text[],text,boolean,text,boolean,text,text,bigint) line 638 at RAISE
```

It looks like partman is trying to parse parent partitioning column as timestamp, which fails.

view thread (6+ messages)  latest in thread

Message-ID: <gh-pgpartman-pg_partman-870@github.com>
Permalink:  ../gh-pgpartman-pg_partman-870@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