syntax error at or near "current_timestamp" while creating partition table

by Chessbrain   Last Updated September 11, 2019 16:06 PM

I am trying to create a partition for the last 30 days. Yet when I run this code:

create table Test_Older30day partition of Test
    for values from (current_timestamp + interval'-30 day') to (current_timestamp);

I get this error:

syntax error at or near "current_timestamp"

I am confused, what am I doing wrong here?

the table looks like this:

create table if not exists Test(
source_name varchar,
event_name varchar,
service_data json,
stamp timestamptz
)partition by range(stamp);

data types match and I have used the partition by range on the date field.



Related Questions


Updated September 20, 2017 14:06 PM

Updated April 22, 2015 00:02 AM

Updated September 13, 2017 15:06 PM

Updated March 09, 2016 07:02 AM

Updated April 14, 2016 08:02 AM