Q:

oracle to postgresql syntax convert

oracle :
CREATE OR REPLACE TRIGGER ORA_ADMIN.T_INCOMING_FILE 
BEFORE INSERT ON ORA_ADMIN.INCOMING_FILE FOR EACH ROW
DECLARE
 err_num NUMBER;
 err_msg VARCHAR2(100);
BEGIN
SELECT incoming_file_seq.NEXTVAL into :NEW.ID from dual ;
EXCEPTION
    WHEN OTHERS THEN
  -- throw application error
    err_num := SQLCODE;
    err_msg := SUBSTR(SQLERRM, 1, 100);
  RAISE_APPLICATION_ERROR( 100, 'Insert into incoming_file failed ' ||err_num || err_msg );
END;
/

postgresql : what is the equivalent syntax in postgresql?

A:

Both are in pl/sql. So its not a big deal to convert the schema. But still, there are many restrictions to convert these kinds of the trigger. I suggest,
http://www.sqlines.com/online
https://aws.amazon.com/documentation/SchemaConversionTool/  (but this will work on top of OLTP, it'll not convert the queries)

