postgresql-unit 1.0 released
Christoph Berg <[email protected]>
| Newsgroups | gmane.comp.db.postgresql.announce |
|---|---|
| Message-ID | <[email protected]> |
postgresql-unit 1.0 released
============================
postgresql-unit implements a PostgreSQL datatype for SI units, plus
byte. The base units can be combined to named and unnamed derived
units using operators defined in the PostgreSQL type system. SI
prefixes are used for input and output, and quantities can be
converted to arbitrary scale.
Examples
--------
# CREATE extension unit;
CREATE EXTENSION
# SELECT '800 m'::unit + '500 m' AS length;
length
--------
1.3 km
# SELECT '120 km/h'::unit AS speed;
speed
-------------
33.3333 m/s
# SELECT '9.81 N'::unit / 'kg' AS gravity;
gravity
------------
9.81 m/s^2
# SELECT '2 MB/min'::unit @ 'GB/d' AS traffic;
traffic
-----------
2.88 GB/d
# SELECT '1 hl'::unit @ '0.5 l' AS bottles_of_beer;
bottles_of_beer
-----------------
200 * 0.5 l
Features
--------
* SI base types: meter (m), kilogram (kg), second (s), ampere (A), kelvin (K),
mole (mol), candela (cd)
* byte (B) is also a base type
* derived units coherent with SI: radian (rad), steradian (sr), hertz (Hz),
newton (N), pascal (Pa), joule (J), watt (W), coulomb (C), volt (V), farad
(F), ohm (Ω), siemens (S), weber (Wb), tesla (T), henry (H), degree Celsius
(°C, support limited), lumen (lm), lux (lx), becquerel (Bq), gray (Gy),
sievert (Sv), katal (kat)
* non-coherent units: minute (min), hour(h), day(d), hectare (ha), litre (l),
tonne (t), bar, astronomical unit (au)
* prefix multiples: da, h, k, M, G, T, P, E, Z, Y
* prefix fractions: d, c, m, μ, n, p, f, a, z, y
* operators: +, -, *, /, ^, conversion to arbitrary scale (@)
Download
--------
The source tarball is available via GitHub:
https://github.com/ChristophBerg/postgresql-unit
Packages for Debian and Ubuntu are available via apt.postgresql.org.
Bug reports and feature requests are welcome!
signature.asc
(application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJX4+nvAAoJEExaa6sS0qeu5BUP/js4AcrEzhga/LbIf7KjvZqA 1ugI0xYsu+ghcK73JvOZrU5DpqG0bVZWeg2O8jdxs8Z67obqAwUzXl3Orhqk3V3K ppVxnYbWTYu8KEaVQ4OJh0xfcoLfphnIAgrU151e4eVo4Y3BcqvhX2eyUBuJFuJn 4E9A6rRYqlQHJoTqEapzIiOssI/MaytFcB0X/eTml5lSrY0P1D5Q5d5OtbjYvC9z L65pziBHZXtNFzejkSYVdBkH+kxo5x1TV0aCzwLTHcJeuZ3iZr5FW2JKe6Wgc+1a 0oxbcbfUVX0JdNqXcA87qTItUgtQkYWJBD+JR85FMWEUwTR+tTosWeeJgiW4c0WA aaye6ucdOfn4VlWOCJqW/3oC6coMj2Yp+liuW5d6fsEqX5VCijrgYhsofMt+SS16 9akSMQZYp4TLfmm0d3N9gK9tBqs98V1qOffBEL6iX4To2QFYi9BRaRfnQi4QcB8s DdCny+4MrZi8jW9LiOoz1j+93e8i1/kOw420lpmB+25Xo4ccHIt9nj0FSAdD5P+N qCr5PVYYNn+LX/a1pzIR95dcqwSzbHSZ24OD6JmdEQeB6fvKR/0Ada9+SprI65we 1qYOERjeuXcNM8opODHnDMOWCJEX4ul9Fdal/0wE1JChjxzoGZICF/EzEMuf0+an 5AkMjZXRGttpU2rUnd+r =qq43 -----END PGP SIGNATURE-----