I have quite a headache of an issue. I am moving a Timestamp with time zone field in Postgresql to a Date (datetime) column in Oracle, using an ETL tool.
The Postgresql Timestamp column (named psql_column) has values such as:
2011-09-13 07:37:24+00
While Oracle expects values in the form of:
DD.MM.YYYY HH24.MI.SS
I have tried several queries on the Postgresql table to retreive the values in a manner suitable to Oracle, such as:
to_char(psql_column, 'DD.MM.YYYY HH24.MI.SS')
Which oracle does not want to accept for some reason (throws ORA-01830)? Then the following line casts the value back to a date value:
to_date(to_char(psql_column, 'DD.MM.YYYY HH24.MI.SS'), 'DD.MM.YYYY HH24.MI.SS')
But this ofcourse only returns the value back to the original Postgresql date format, which Oracle doesn't accept.