INTERVAL data type

The Informix® INTERVAL data type stores a value that represents a span of time. INTERVAL types are divided into two classes: year-month intervals and day-time intervals.

Starting with version 8.4, PostgreSQL provides an INTERVAL data type which is equivalent to the Informix INTERVAL type. The following are some features of the PostgreSQL 8.4 interval type:

Solution

Starting with Genero 2.21, database drivers dbmpgs84x and higher convert the Informix-style INTERVAL type to the native PostgreSQL INTERVAL type. See the data type conversion table for the exact conversion rules.

Important: The PostgreSQL database driver forces the interval style session parameter to 'iso_8601', this is required to insert and fetch interval database with the libpq CAPI functions. You must not change this setting during program execution.

While PostgreSQL INTERVALs support up to 9 digits for the higher unit like Informix, YEAR values range from -178000000 to +178000000 only. This limitation exists in PostgreSQL 8.4 and maybe solved in future versions.

With PostgreSQL and driver versions prior to 8.4, the INTERVAL data type is converted to CHAR(50).