creating pg_partman parent table generates error `invalid input syntax for type bigint: "monthly"`

2.2k Views Asked by At

I'm trying to use pg_partman extension for the first time but cannot create the parent table. This is my command:

SELECT partman.create_parent('public.mytable_by_date','start_time','native','monthly');

That generates this error:

ERROR:  invalid input syntax for type bigint: "monthly"
CONTEXT: PL/pgSQL function partman.create_parent(text,text,text,text,text[],integer,text,text,boolean,text,text,text[],boolean,text,boolean,text) line 551 at assignment
DETAIL: 
HINT: 
CONTEXT:  PL/pgSQL function partman.create_parent(text,text,text,text,text[],integer,text,text,boolean,text,text,text[],boolean,text,boolean,text) line 788 at RAISE

I tried daily and quarterly too but they return same error.

pg_partman: 4.6.0 Postgres:12.9 Ubuntu: 20.04.01

1

There are 1 best solutions below

0
On

I found out the Problem. The start_time column type is integer and data is stored using unix timestamp but as number and monthly only works with data columns. I have to convert start_time column to timestamp first.