pgratio

Extension for PostgreSQL to support rational numbers (fractions).

Installation

  1. Download the extension by clicking on one of the links in the “Download” section below.
  2. Extract the tar.zst file.
  3. Run “make install”.
  4. Use “CREATE EXTENSION pgratio;” as an SQL command to load the extension into a database. This will then provide the new data type “rational”.

Example usage

postgres=> CREATE EXTENSION pgratio;
CREATE EXTENSION
postgres=> SELECT rational(2, 3) - rational(1.2) AS result;
result
--------
-8/15
(1 row)

Documentation

Refer to the README.html file in the packages below for further documentation.

Download

Changes

  • 2024-12-23: Initial release of version 0.1