I am running a bunch of cleanup scripts that are parametrized by dates on PostgreSQL 8.3 database.
I am just trying to parametrize a bunch of code with a couple of date variables and testing the create table gives me the following error:
WARNING: could not dump unrecognized node type: 858861618
Here is the code that caused the problem:
CREATEOR REPLACE FUNCTION tst(
start_day VARCHAR,
end_day VARCHAR
)
RETURNS VOID
VOLATILE
STRICT
LANGUAGE plpythonu
AS $$
parameters = dict(
start_day = start_day,
end_day = end_day )
plpy.execute(
"""
drop table testtable cascade;
CREATE TABLE testtable (
start_time timestamp,
column2 text)
with (appendonly=true,orientation=column,compresstype=quicklz,compresslevel=1,fillfactor=95)
partition by range (start_time)
( start ( '{start_day}'::date ) end ('{end_day}'::date) every ('1 day'::interval)
with (appendonly=true,orientation=column,compresstype=quicklz,compresslevel=1,fillfactor=95),
default partition other_dates with (appendonly=true,orientation=column,compresstype=quicklz,compresslevel=1) );
analyze dhcp.l2r_nogeo;
""".format(**parameters))
$$;
How do I use python to parametrize a simple create table script without generating the error WARNING: could not dump unrecognized node type: 858861618?