I am trying to convert the below definition to Postgres.
Current Oracle code:
PROCEDURE Run_All (inDate DATE DEFAULT SYSDATE) IS
In Postgres I used different versions:
CREATE OR REPLACE FUNCTION ssp2_pcat.gen_fios_xml$run_all (indate timestamp(0) DEFAULT CURRENT_DATE)CREATE OR REPLACE FUNCTION ssp2_pcat.gen_fios_xml$run_all (indate timestamp without timezone DEFAULT ('now'::text)::date)CREATE OR REPLACE FUNCTION ssp2_pcat.gen_fios_xml$run_all (indate date DEFAULT ('now'::text)::date)CREATE OR REPLACE FUNCTION ssp2_pcat.gen_fios_xml$run_all (indate timestamp(0) DEFAULT CURRENT_TIMESTAMP::timestamp(0))
But still it's throwing an error as below:
ERROR: column "timestamp" does not exist
LINE 1: SELECT TIMESTAMP
^
QUERY: SELECT TIMESTAMP
CONTEXT: PL/pgSQL function "gen_fios_xml$run_all"(date) line 13 during statement block local variable initialization
SQL state: 42703
What would be the right way to convert, am I missing something in Postgres? Any update is absolutely appreciated!