↑↓ select↵ open⌫ change scopeOpen full search

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

Wiki / Functions

trim_array

Trims an array by removing the last n elements. If the array is multidimensional, only the first dimension is trimmed.

English manual coverage begins with PostgreSQL 7.1. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

group
array
group label
Array Functions And Operators
lang
en
layout
table-new
pages
functions-array.html
prose only
false

Definition PG 18

Trims an array by removing the last n elements. If the array is multidimensional, only the first dimension is trimmed.

Signatures and overloads

trim_array ( array anyarray, n integer ) → anyarray → anyarray
Trims an array by removing the last n elements. If the array is multidimensional, only the first dimension is trimmed.

Compare versions

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · wiki-repair-20261023:d2fa7688eb0d8705028d85e56618ac19f391cb00e267c3752ba4366a7b9753f3

Text language: en · wiki-repair-20261023:d2fa7688eb0d8705028d85e56618ac19f391cb00e267c3752ba4366a7b9753f3