pgmp is a PostgreSQL extension module that adds support for the arbitrary precision data types offered by the GMP library. It provides higher performance arithmetic for numbers, only limited by the 1GB varlena maximum size, a rational data type for absolute precision storage and arithmetic, and specialized functions to deal with prime numbers, random numbers, and factorization. The GMP data types can be used in mixed arithmetic with other PostgreSQL numeric types and indexed using the btree or hash methods. The extension is compatible with PostgreSQL 8.4 and later, and the package includes comprehensive documentation and regression tests.