SYSTIMESTAMP Function - Oracle to PostgreSQL Migration

In Oracle, the SYSTIMESTAMP function returns the current date and time with fractional seconds and with the time zone of the current database instance.

In PostgreSQL you can use the CURRENT_TIMESTAMP or NOW functions that also include fractional seconds and time zone.

Oracle:

  -- Get the current datetime with time zone
  SELECT SYSTIMESTAMP FROM dual;
  /* 16-DEC-24 02.46.38.954000 PM +01:00 */

PostgreSQL:

  -- Get the current datetime with time zone
  SELECT CURRENT_TIMESTAMP;
  /* 2024-12-16 14:46:38.954841+01 */

For more information, see Oracle to PostgreSQL Migration.