select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

FUNCTIONS / SET RETURNING FUNCTIONS

generate_subscripts

Read PG 18 manual ↗

Generates a series comprising the valid subscripts of the dim'th dimension of the given array.

Signatures & examples

generate_subscripts ( array anyarray, dim integer ) → setof integer
Generates a series comprising the valid subscripts of the dim'th dimension of the given array.
generate_subscripts ( array anyarray, dim integer, reverse boolean ) → setof integer
Generates a series comprising the valid subscripts of the dim'th dimension of the given array. When reverse is true, returns the series in reverse order.
Version history 1
  1. PG 12 → 13changed

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source