Skip to content

numpgsql

Array and numerical computing library for PostgreSQL

numpgsql · Array and numerical computing library for PostgreSQL

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
100486numpgsqlnumpgsql0.0.1FUNCMITC++

PostgreSQL · 11

Usage

Sources:

numpgsql version 0.0.1 provides NumPy-inspired operations over PostgreSQL numeric arrays. Its C++/Boost implementation includes elementwise arithmetic and transcendental functions, vector reductions and aggregates, index/boolean slicing, sorting/reversal, and seeded random arrays and distributions.

Example

CREATE EXTENSION numpgsql;
SELECT cos(ARRAY[5, 1, 6, 4]::real[]);
SELECT ARRAY[10, 20, 30, 40] @ ARRAY[2, 4];
SELECT random_seed(42);
SELECT random_randn(2, 2);

The project lists broadcasting, type conversion, axis aggregation, and documentation as unfinished and has not been updated since 2019. Many functions overload common names and operators, and result types inherit PostgreSQL array element semantics, including integer truncation/overflow behavior. Do not treat it as NumPy-compatible without tests for shape, type, null, overflow, and reproducibility requirements.

Table reader