unit
extension adds support for SI (International System of Units) measurements and conversions in PostgreSQL.
Your Nile database arrives with the unit extension already enabled.
Overview
The unit extension provides:- Storage and manipulation of SI units and measurements
- Automatic unit conversion
- Dimensional analysis
- Support for SI prefixes (kilo, milli, etc.)
- Mathematical operations with units
Basic Usage
Creating Unit Values
Theunit
type accepts values in the format number unit
:
Unit Conversions
Units can be converted using the@>
operator or the unit_transform
function: