title: PostgreSQL 11 - Getting error when trying to partition with timestamp
body: <p>I'm using postgres-11 on my app and I have an issue with the partitioning.</p>
  <p>I created a partitioned table as follow:</p>
  <pre><code>CREATE TABLE IF NOT EXISTS MEASUREMENT (
  
      date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
      ...
      CONSTRAINT MEASUREMENT_PK PRIMARY KEY (date,...)
  )
  PARTITION BY RANGE (date);
  
  CREATE TABLE MEASUREMENT_P_INFINITY PARTITION OF MEASUREMENT FOR VALUES FROM (MINVALUE) TO (MAXVALUE);
  </code></pre>
  <p>Later, when I tried to split the partition with the format <code>'yyyy-MM-dd HH24'</code> using <code>TO_TIMESTAMP</code>:</p>
  <pre><code>       ALTER TABLE MEASUREMENT DETACH PARTITION MEASUREMENT_P_INFINITY;
      
         CREATE TABLE MEASUREMENT_P_2020_11_24_03
           PARTITION OF MEASUREMENT
           FOR VALUES FROM (TO_TIMESTAMP('1970-01-01 10', 'yyyy-MM-dd HH24'))
           TO (TO_TIMESTAMP('2020-11-24 04', 'yyyy-MM-dd HH24'));
      
         ALTER TABLE MEASUREMENT ATTACH PARTITION MEASUREMENT_P_INFINITY
           FOR VALUES FROM (TO_TIMESTAMP('2020-11-24 04', 'yyyy-MM-dd HH24'))
           TO (MAXVALUE);
  </code></pre>
  <p>I received the follow error message:</p>
  <pre><code>org.postgresql.util.PSQLException: ERROR: syntax error at or near &quot;TO_TIMESTAMP&quot;
  </code></pre>
  <p>I tried a simple query:
  <code>select TO_TIMESTAMP('1970-01-01 10', 'yyyy-MM-dd HH24');</code>
  and it works just fine.</p>
  <p>When I used postgres-13 it works OK.</p>
  <p>PostgreSQL 11 partiotioning Documentation: <a href="https://www.postgresql.org/docs/11/ddl-partitioning.html#DDL-PARTITIONING-DECLARATIVE" rel="nofollow noreferrer">https://www.postgresql.org/docs/11/ddl-partitioning.html#DDL-PARTITIONING-DECLARATIVE</a></p>