User Documentation
Ispirer Capabilities - PostgreSQL Migration
Pricing
Versions: PostgreSQL 8.x and 7.x
| PostgreSQL - INTERVAL | |
|---|---|
| Syntax | INTERVAL[(p)] |
| Data | Period of time; Interval value is a string in single quotes with the following syntax: '[@] value unit { value unit … }' @ is optional, value is a number, unit is microsecond, millisecond, second, minute, hour, day, week, month, year, decade, century, millennium or their plural form (years, days etc) and abbreviations (min, sec) |
| Parameters | p is the number of digits in the fractional part of second, 0 ⇐ p ⇐ 6 |
| Default | p is 6 |
| Range | -178000000 to 178000000 years |
| Storage Size | 12 bytes |
| Standards | ANSI SQL |
An example of INTERVAL:
'1 day 3 hours 31 min 24 sec'
Quantities of days, hours, minutes, and seconds can be specified without explicit unit markings. For example, the previous interval string is equal to
'1 3:31:24'
PostgreSQL INTERVAL - Equivalents in Other Databases
| Database | Data Type and Conversion | |
|---|---|---|
| Oracle | INTERVAL YEAR(p) TO MONTH | INTERVAL DAY(p1) TO SECOND(p2) |
| Informix | INTERVAL year-month | INTERVAL day-time |
| HP Neoview | INTERVAL year-month | INTERVAL day-time |
Related Data Types in PostgreSQL
| Data Types | |||
|---|---|---|---|
| Datetime | DATE | TIME(p) | TIMESTAMP(p) |