I think it's only a syntax problem :
to_timestamp('null','-MM-ddhh24:mi:ss')::TIMESTAMP
In this form your 'null' parameter is a text which dont match for your
definition, so the function is waiting for an integer representing the
year and fails.
But if you write :
to_timestamp(null,'-MM
Technical Doubts writes:
> insert into registers_info (regid,transid,regdate,canceldate) values
> ('reg1',1,to_timestamp('2013-07-24','-MM-dd
> hh24:mi:ss')::TIMESTAMP,to_timestamp('null','-MM-dd
> hh24:mi:ss')::TIMESTAMP);
> The above query works fine in Postgres 8.3 version.
> But the