Skip to content

intagg

integer aggregator and enumerator (obsolete)

intagg · integer aggregator and enumerator (obsolete)

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
4970intaggintagg1.1FUNCPostgreSQLC
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
----d-rNoNoNoYesyesno
Relationships
See Alsointarray count_distinct arraymath

Packages

PG19PG18PG17PG16PG15
1.11.11.11.11.1
This contrib extension ships with PostgreSQL.

Install

Create this extension with:

CREATE EXTENSION intagg;

Usage

intagg: integer aggregator and enumerator (obsolete)

Provides an integer aggregator and enumerator. These are now wrappers around the built-in array_agg() and unnest() functions.

CREATE EXTENSION intagg;

Functions

FunctionDescription
int_array_aggregate(integer)Aggregate integers into an array (wrapper for array_agg())
int_array_enum(integer[])Expand array into rows (wrapper for unnest())

Examples

-- Aggregate integers into an array
SELECT id_left, int_array_aggregate(id_right) AS rights
FROM many_to_many
GROUP BY id_left;

-- Expand an integer array into rows
SELECT int_array_enum(ARRAY[1, 2, 3, 4]);
-- Returns: 1, 2, 3, 4 (as separate rows)

Note: This module is obsolete. Use the built-in array_agg() and unnest() functions instead for new code.

Table reader