# PostgreSQL Domain Integrity In Depth

DevFeed: [PostgreSQL Domain Integrity In Depth](<https://devfeed.tech/articles/postgresql-domain-integrity-in-depth-21478.md>)

Original publisher: [Read original article](<https://begriffs.com/posts/2017-10-21-sql-domain-integrity.html>)

Published: 2017-10-21T00:00:00Z

Content type: article

Language: en

Sources: [Joe Nelson](<https://devfeed.tech/sources/joe-nelson.md>)

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

Tags: [article](<https://devfeed.tech/tags/article.md>), [data](<https://devfeed.tech/tags/data.md>), [errors](<https://devfeed.tech/tags/errors.md>), [floating-point](<https://devfeed.tech/tags/floating-point.md>), [locale](<https://devfeed.tech/tags/locale.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [precision](<https://devfeed.tech/tags/precision.md>), [sql](<https://devfeed.tech/tags/sql.md>), [techniques](<https://devfeed.tech/tags/techniques.md>), [types](<https://devfeed.tech/tags/types.md>), [us](<https://devfeed.tech/tags/us.md>)

## AI overview

An in-depth guide to SQL domain integrity, centered on PostgreSQL. It explains how column types and custom domains restrict values, prevent input errors, and improve data consistency, with practical examples involving fixed-precision monetary values and gas prices.

## Source excerpt

2017-10-21 SQL has many features to protect data, and domain integrity constraints are one of the most fundamental. Put simply, they restrict columns to sensible values and prevent data input errors and other problems. On the surface domain integrity is simpler than other techniques such as referential integrity. Domains usually don't need to cross-reference values in multiple tables. However in this article we'll see some advanced tricks to keep data squeaky clean.