# PostgreSQL Data Types: Ranges

DevFeed: [PostgreSQL Data Types: Ranges](<https://devfeed.tech/articles/postgresql-data-types-ranges-34592.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2018/04/postgresql-data-types-ranges/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2018-04-18T11:41:12Z

Content type: tutorial

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [data type](<https://devfeed.tech/topics/data-type.md>), [SQL](<https://devfeed.tech/topics/sql.md>)

Tags: [data-type](<https://devfeed.tech/tags/data-type.md>), [extension](<https://devfeed.tech/tags/extension.md>), [function](<https://devfeed.tech/tags/function.md>), [indexes](<https://devfeed.tech/tags/indexes.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [range](<https://devfeed.tech/tags/range.md>), [sql](<https://devfeed.tech/tags/sql.md>), [transformation](<https://devfeed.tech/tags/transformation.md>), [types](<https://devfeed.tech/tags/types.md>), [window](<https://devfeed.tech/tags/window.md>)

## AI overview

This tutorial introduces PostgreSQL range types, using daterange values to represent exchange-rate validity periods. It demonstrates loading and transforming exchange-rate data, then enforcing non-overlapping periods with exclusion constraints, GiST indexes, and the btree_gist extension.

## Source excerpt

Continuing our series of PostgreSQL Data Types today we're going to introduce the PostgreSQL ranges data type. Range types are a unique feature of PostgreSQL, managing two dimensions of data in a single column, and allowing advanced processing. The main example is the daterange data type, which stores as a single value a lower and an upper bound of the range as a single value. This allows PostgreSQL to implement a concurrent safe check against overlapping ranges, as we're going to see in this article.