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
I found out the Problem. The
start_time
column type is integer and data is stored using unix timestamp but as number andmonthly
only works with data columns. I have to convertstart_time
column to timestamp first.