pgpartman / pg_partman

Partition management extension for PostgreSQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can I create pg_partman extension to 4.7.2 (vs 5.0) due to "ERROR: native is not a valid partitioning type for pg_partman"

rsquaretrade opened this issue · comments

Can I create pg_partman extension to 4.7 vs the latest version?

I migrated to native, the partitioning is monthly. I'm running into this error:

ERROR: Special partition interval values from old pg_partman versions (monthly) are no longer supported. Please use a supported interval time value from core PostgreSQL (https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-INTERVAL-INPUT)
CONTEXT: PL/pgSQL function partman.create_parent(text,text,text,text,text,integer,text,boolean,text,text[],text,boolean,text) line 74 at RAISE

I changed the interval to MONTH, now getting this error:

postgresql://postgres@[local:/var/run/postgresql/14/svc_load]:5432 12:07:35
mmdm=> SELECT partman.create_parent('mmdm.wic_raw_log'
mmdm(# , 'created'
mmdm(# , 'month'
mmdm(# , 'native'
mmdm(# , p_premake:=3
mmdm(# , p_start_partition:='2024-02-01'
mmdm(# , p_template_table:='partman.template_mmdm_wic_raw_log'
mmdm(# );
ERROR: native is not a valid partitioning type for pg_partman
CONTEXT: PL/pgSQL function partman.create_parent(text,text,text,text,text,integer,text,boolean,text,text[],text,boolean,text) line 111 at RAISE
DETAIL:
HINT:
CONTEXT: PL/pgSQL function partman.create_parent(text,text,text,text,text,integer,text,boolean,text,text[],text,boolean,text) line 629 at RAISE

I also tried interval '1 month'

postgresql://postgres@[local:/var/run/postgresql/14/svc_load]:5432 12:33:12
mmdm=> SELECT partman.create_parent('mmdm.wic_raw_log'
, 'created'
, '1 month'
, 'native'
, p_premake:=3
, p_start_partition:='2024-02-01'
, p_template_table:='partman.template_mmdm_wic_raw_log'
);
ERROR: native is not a valid partitioning type for pg_partman
CONTEXT: PL/pgSQL function partman.create_parent(text,text,text,text,text,integer,text,boolean,text,text[],text,boolean,text) line 111 at RAISE
DETAIL:
HINT:
CONTEXT: PL/pgSQL function partman.create_parent(text,text,text,text,text,integer,text,boolean,text,text[],text,boolean,text) line 629 at RAISE

SELECT partman.create_parent('mmdm.wic_raw_log'
, 'created'
, '1 month'
, 'range'
, p_premake:=3
, p_start_partition:='2024-02-01'
, p_template_table:='partman.template_mmdm_wic_raw_log'
);
This one works.

p_type='range'

Glad you were able to figure it out. Please review the changelog, especially for 5.0 since it was quite extensive

https://github.com/pgpartman/pg_partman/blob/master/CHANGELOG.md