Self-managing PostgreSQL partition tables

前端 未结 4 969
深忆病人
深忆病人 2021-01-03 08:52

I am trying to make a self-managing partition table setup with Postgres. It all revolves around this function but I can\'t seem to get Postgres to accept my table names. Any

4条回答
  •  粉色の甜心
    2021-01-03 09:37

    You need to put your date literals in single quotes. Currently you are executing something like this:

     CHECK ( date >= DATE 2011-10-25 AND date < DATE 2011-11-25 )
    

    which is invalid. In this case 2011-10-25 is interpreted as 2011 minus 10 minus 25

    Your code needs to create the SQL using single quotes around the date literal:

    CHECK ( date >= DATE '2011-10-25' AND date < DATE '2011-11-25' )
    

提交回复
热议问题