DATE and DATETIME data types

Informix® provides two data types to store dates and time information:

PostgreSQL provides the following data type to store date and time information:

String representing date time information

Informix is able to convert quoted strings to DATE / DATETIME data if the string contents matches environment parameters (i.e. DBDATE, GL_DATETIME). As in Informix, PostgreSQL can convert quoted strings to date time data according to the DateStyle session parameter. PostgreSQL always accepts ISO date time strings.

Date arithmetic

Solution

PostgreSQL has the same DATE data type as Informix ( year, month, day ). So you can use PostgreSQL DATE data type for Informix DATE columns.

PostgreSQL TIME(0) WITHOUT TIME ZONE data type can be used to store Informix DATETIME HOUR TO SECOND values. The database interface makes the conversion automatically.

Informix DATETIME values with any precision from YEAR to FRACTION(n) can be stored in PostgreSQL TIMESTAMP(n+1) WITHOUT TIME ZONE columns. The database interface makes the conversion automatically. Missing date or time parts default to 1900-01-01 00:00:00.0. For example, when using a DATETIME HOUR TO MINUTE with the value of "11:45", the PostgreSQL TIMESTAMP value will be "1900-01-01 11:45:00.0".

Note:
  • SQL Statements using expressions with TODAY / CURRENT / EXTEND must be reviewed and adapted to the native syntax.
  • Literal DATETIME and INTERVAL expressions (i.e. DATETIME ( 1999-10-12) YEAR TO DAY) are not converted.