0

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?

user7980
  • 703
  • 3
  • 15
  • 28
  • 1
    Unrelated to your problem, but 8.3 is de-supported and really old. You should think about upgrading to an up-to-date version (e.g. 9.2) as soon as possible –  Feb 26 '13 at 19:41
  • Well, possibly unrelated. Lots of bug fixes between 8.3 and 9.2. – Craig Ringer Feb 27 '13 at 00:30

0 Answers0