Ispirer Ispirer
 


Ispirer Home Page Ispirer SQLWays Product Page - Migration to PostgreSQL Request SQLWays

PostgreSQL Data Types - INTERVAL

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

Related Data Types in PostgreSQL

Data Types
Datetime DATE TIME(p) TIMESTAMP(p)


Ispirer Home Page Ispirer SQLWays Product Page - Migration to PostgreSQL Request SQLWays

sqlways/postgresql/data-types/interval.txt · Last modified: May 07, 2018, 03:15:32 PM (external edit)
 
© 1999-2019, Ispirer Systems Ltd.
All Rights Reserved.  Privacy Statement