1

how to convert SYS_EXTRACT_UTC (SYSTIMESTAMP) from oracle to postgres?

Groot
  • 21
  • 3
  • 1
    `current_timestamp at time zone 'UTC'` maybe? –  May 03 '19 at 10:01
  • results in this error: 42883: function sys_extract_utc(timestamp without time zone) does not exist – Groot May 03 '19 at 10:13
  • did you try my suggestion: `current_timestamp at time zone 'UTC'` –  May 03 '19 at 10:27
  • Yes, and he gave me that error – Groot May 03 '19 at 10:40
  • My suggestion does not include a function named `SYS_EXTRACT_UTC` so you can't be using that if you get that error: https://rextester.com/IHIVVY97156 –  May 03 '19 at 10:51
  • 1
    That function does not exist in postgres, maybe try something along the lines of casting the field to a utc timestamp e.g. `select (whatever_your_field_is_called)::timestamp with time zone at time zone 'UTC'` ? – Lucas May 03 '19 at 13:23
  • Which table columns are you talking about? `systimestamp` is an Oracle function and the equivalent to that is `current_timestamp` in Postgres. If you want something different, then please **[edit]** your question and show us the **real** code you are having trouble with ([edit] your question do not post additional information or code in comments) –  May 03 '19 at 13:53

0 Answers0