colnames
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
colnames | 1.7.0 | UTIL | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4360 | colnames | No | Yes | No | Yes | No | Yes | - |
| Related | pg_describe describe_resultset get_column pltoolbox hstore |
|---|
Distribution 1.7.1 retains extension version 1.7.0; colnames(record) returns name[]. No preload or runtime extension dependencies. Upstream release lists PG8.2-17; PG14-18 verified across all 16 PGSTY target platforms.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.7.0 | 1817161514 | colnames | - |
| RPM | PIGSTY | 1.7.1 | 1817161514 | colnames_$v | - |
| DEB | PIGSTY | 1.7.1 | 1817161514 | postgresql-$v-colnames | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.7.1 el8.x86_64.pg18 : colnames_18 colnames_18-1.7.1-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.7.1 el8.x86_64.pg17 : colnames_17 colnames_17-1.7.1-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.7.1 el8.x86_64.pg16 : colnames_16 colnames_16-1.7.1-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.7.1 el8.x86_64.pg15 : colnames_15 colnames_15-1.7.1-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.7.1 el8.x86_64.pg14 : colnames_14 colnames_14-1.7.1-1PGSTY.el8.x86_64.rpm
|
| el8.aarch64 | PIGSTY 1.7.1 el8.aarch64.pg18 : colnames_18 colnames_18-1.7.1-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.7.1 el8.aarch64.pg17 : colnames_17 colnames_17-1.7.1-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.7.1 el8.aarch64.pg16 : colnames_16 colnames_16-1.7.1-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.7.1 el8.aarch64.pg15 : colnames_15 colnames_15-1.7.1-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.7.1 el8.aarch64.pg14 : colnames_14 colnames_14-1.7.1-1PGSTY.el8.aarch64.rpm
|
| el9.x86_64 | PIGSTY 1.7.1 el9.x86_64.pg18 : colnames_18 colnames_18-1.7.1-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.7.1 el9.x86_64.pg17 : colnames_17 colnames_17-1.7.1-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.7.1 el9.x86_64.pg16 : colnames_16 colnames_16-1.7.1-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.7.1 el9.x86_64.pg15 : colnames_15 colnames_15-1.7.1-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.7.1 el9.x86_64.pg14 : colnames_14 colnames_14-1.7.1-1PGSTY.el9.x86_64.rpm
|
| el9.aarch64 | PIGSTY 1.7.1 el9.aarch64.pg18 : colnames_18 colnames_18-1.7.1-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.7.1 el9.aarch64.pg17 : colnames_17 colnames_17-1.7.1-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.7.1 el9.aarch64.pg16 : colnames_16 colnames_16-1.7.1-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.7.1 el9.aarch64.pg15 : colnames_15 colnames_15-1.7.1-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.7.1 el9.aarch64.pg14 : colnames_14 colnames_14-1.7.1-1PGSTY.el9.aarch64.rpm
|
| el10.x86_64 | PIGSTY 1.7.1 el10.x86_64.pg18 : colnames_18 colnames_18-1.7.1-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.7.1 el10.x86_64.pg17 : colnames_17 colnames_17-1.7.1-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.7.1 el10.x86_64.pg16 : colnames_16 colnames_16-1.7.1-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.7.1 el10.x86_64.pg15 : colnames_15 colnames_15-1.7.1-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.7.1 el10.x86_64.pg14 : colnames_14 colnames_14-1.7.1-1PGSTY.el10.x86_64.rpm
|
| el10.aarch64 | PIGSTY 1.7.1 el10.aarch64.pg18 : colnames_18 colnames_18-1.7.1-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.7.1 el10.aarch64.pg17 : colnames_17 colnames_17-1.7.1-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.7.1 el10.aarch64.pg16 : colnames_16 colnames_16-1.7.1-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.7.1 el10.aarch64.pg15 : colnames_15 colnames_15-1.7.1-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.7.1 el10.aarch64.pg14 : colnames_14 colnames_14-1.7.1-1PGSTY.el10.aarch64.rpm
|
| d12.x86_64 | PIGSTY 1.7.1 d12.x86_64.pg18 : postgresql-18-colnames postgresql-18-colnames_1.7.1-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.7.1 d12.x86_64.pg17 : postgresql-17-colnames postgresql-17-colnames_1.7.1-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.7.1 d12.x86_64.pg16 : postgresql-16-colnames postgresql-16-colnames_1.7.1-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.7.1 d12.x86_64.pg15 : postgresql-15-colnames postgresql-15-colnames_1.7.1-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.7.1 d12.x86_64.pg14 : postgresql-14-colnames postgresql-14-colnames_1.7.1-1PGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY 1.7.1 d12.aarch64.pg18 : postgresql-18-colnames postgresql-18-colnames_1.7.1-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.7.1 d12.aarch64.pg17 : postgresql-17-colnames postgresql-17-colnames_1.7.1-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.7.1 d12.aarch64.pg16 : postgresql-16-colnames postgresql-16-colnames_1.7.1-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.7.1 d12.aarch64.pg15 : postgresql-15-colnames postgresql-15-colnames_1.7.1-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.7.1 d12.aarch64.pg14 : postgresql-14-colnames postgresql-14-colnames_1.7.1-1PGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY 1.7.1 d13.x86_64.pg18 : postgresql-18-colnames postgresql-18-colnames_1.7.1-1PGSTY~trixie_amd64.deb
| PIGSTY 1.7.1 d13.x86_64.pg17 : postgresql-17-colnames postgresql-17-colnames_1.7.1-1PGSTY~trixie_amd64.deb
| PIGSTY 1.7.1 d13.x86_64.pg16 : postgresql-16-colnames postgresql-16-colnames_1.7.1-1PGSTY~trixie_amd64.deb
| PIGSTY 1.7.1 d13.x86_64.pg15 : postgresql-15-colnames postgresql-15-colnames_1.7.1-1PGSTY~trixie_amd64.deb
| PIGSTY 1.7.1 d13.x86_64.pg14 : postgresql-14-colnames postgresql-14-colnames_1.7.1-1PGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 1.7.1 d13.aarch64.pg18 : postgresql-18-colnames postgresql-18-colnames_1.7.1-1PGSTY~trixie_arm64.deb
| PIGSTY 1.7.1 d13.aarch64.pg17 : postgresql-17-colnames postgresql-17-colnames_1.7.1-1PGSTY~trixie_arm64.deb
| PIGSTY 1.7.1 d13.aarch64.pg16 : postgresql-16-colnames postgresql-16-colnames_1.7.1-1PGSTY~trixie_arm64.deb
| PIGSTY 1.7.1 d13.aarch64.pg15 : postgresql-15-colnames postgresql-15-colnames_1.7.1-1PGSTY~trixie_arm64.deb
| PIGSTY 1.7.1 d13.aarch64.pg14 : postgresql-14-colnames postgresql-14-colnames_1.7.1-1PGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 1.7.1 u22.x86_64.pg18 : postgresql-18-colnames postgresql-18-colnames_1.7.1-1PGSTY~jammy_amd64.deb
| PIGSTY 1.7.1 u22.x86_64.pg17 : postgresql-17-colnames postgresql-17-colnames_1.7.1-1PGSTY~jammy_amd64.deb
| PIGSTY 1.7.1 u22.x86_64.pg16 : postgresql-16-colnames postgresql-16-colnames_1.7.1-1PGSTY~jammy_amd64.deb
| PIGSTY 1.7.1 u22.x86_64.pg15 : postgresql-15-colnames postgresql-15-colnames_1.7.1-1PGSTY~jammy_amd64.deb
| PIGSTY 1.7.1 u22.x86_64.pg14 : postgresql-14-colnames postgresql-14-colnames_1.7.1-1PGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY 1.7.1 u22.aarch64.pg18 : postgresql-18-colnames postgresql-18-colnames_1.7.1-1PGSTY~jammy_arm64.deb
| PIGSTY 1.7.1 u22.aarch64.pg17 : postgresql-17-colnames postgresql-17-colnames_1.7.1-1PGSTY~jammy_arm64.deb
| PIGSTY 1.7.1 u22.aarch64.pg16 : postgresql-16-colnames postgresql-16-colnames_1.7.1-1PGSTY~jammy_arm64.deb
| PIGSTY 1.7.1 u22.aarch64.pg15 : postgresql-15-colnames postgresql-15-colnames_1.7.1-1PGSTY~jammy_arm64.deb
| PIGSTY 1.7.1 u22.aarch64.pg14 : postgresql-14-colnames postgresql-14-colnames_1.7.1-1PGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY 1.7.1 u24.x86_64.pg18 : postgresql-18-colnames postgresql-18-colnames_1.7.1-1PGSTY~noble_amd64.deb
| PIGSTY 1.7.1 u24.x86_64.pg17 : postgresql-17-colnames postgresql-17-colnames_1.7.1-1PGSTY~noble_amd64.deb
| PIGSTY 1.7.1 u24.x86_64.pg16 : postgresql-16-colnames postgresql-16-colnames_1.7.1-1PGSTY~noble_amd64.deb
| PIGSTY 1.7.1 u24.x86_64.pg15 : postgresql-15-colnames postgresql-15-colnames_1.7.1-1PGSTY~noble_amd64.deb
| PIGSTY 1.7.1 u24.x86_64.pg14 : postgresql-14-colnames postgresql-14-colnames_1.7.1-1PGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY 1.7.1 u24.aarch64.pg18 : postgresql-18-colnames postgresql-18-colnames_1.7.1-1PGSTY~noble_arm64.deb
| PIGSTY 1.7.1 u24.aarch64.pg17 : postgresql-17-colnames postgresql-17-colnames_1.7.1-1PGSTY~noble_arm64.deb
| PIGSTY 1.7.1 u24.aarch64.pg16 : postgresql-16-colnames postgresql-16-colnames_1.7.1-1PGSTY~noble_arm64.deb
| PIGSTY 1.7.1 u24.aarch64.pg15 : postgresql-15-colnames postgresql-15-colnames_1.7.1-1PGSTY~noble_arm64.deb
| PIGSTY 1.7.1 u24.aarch64.pg14 : postgresql-14-colnames postgresql-14-colnames_1.7.1-1PGSTY~noble_arm64.deb
|
| u26.x86_64 | PIGSTY 1.7.1 u26.x86_64.pg18 : postgresql-18-colnames postgresql-18-colnames_1.7.1-1PGSTY~resolute_amd64.deb
| PIGSTY 1.7.1 u26.x86_64.pg17 : postgresql-17-colnames postgresql-17-colnames_1.7.1-1PGSTY~resolute_amd64.deb
| PIGSTY 1.7.1 u26.x86_64.pg16 : postgresql-16-colnames postgresql-16-colnames_1.7.1-1PGSTY~resolute_amd64.deb
| PIGSTY 1.7.1 u26.x86_64.pg15 : postgresql-15-colnames postgresql-15-colnames_1.7.1-1PGSTY~resolute_amd64.deb
| PIGSTY 1.7.1 u26.x86_64.pg14 : postgresql-14-colnames postgresql-14-colnames_1.7.1-1PGSTY~resolute_amd64.deb
|
| u26.aarch64 | PIGSTY 1.7.1 u26.aarch64.pg18 : postgresql-18-colnames postgresql-18-colnames_1.7.1-1PGSTY~resolute_arm64.deb
| PIGSTY 1.7.1 u26.aarch64.pg17 : postgresql-17-colnames postgresql-17-colnames_1.7.1-1PGSTY~resolute_arm64.deb
| PIGSTY 1.7.1 u26.aarch64.pg16 : postgresql-16-colnames postgresql-16-colnames_1.7.1-1PGSTY~resolute_arm64.deb
| PIGSTY 1.7.1 u26.aarch64.pg15 : postgresql-15-colnames postgresql-15-colnames_1.7.1-1PGSTY~resolute_arm64.deb
| PIGSTY 1.7.1 u26.aarch64.pg14 : postgresql-14-colnames postgresql-14-colnames_1.7.1-1PGSTY~resolute_arm64.deb
|
Build
You can build the RPM / DEB packages for colnames using pig build:
Install
You can install colnames directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Sources:
colnames provides colnames(record), returning the input record’s field names as a name[]. Use it in generic triggers or dynamic SQL helpers that need a composite value’s structure without converting its values to JSON. Distribution version 1.7.1 retains extension version 1.7.0.
Core Workflow
The three calls return {f1,f2,f3}, {id,name}, and {id,name} respectively. Anonymous rows receive generated names; named rows preserve their attribute names. A typed null works because its composite type supplies the descriptor. An untyped null does not identify a composite type.
Function Behavior
colnames(record) returns name[], is STABLE, and is deliberately not STRICT. It preserves column order and quoted identifier spelling, omits dropped columns, and returns an empty array for an empty composite type. It reads the row descriptor rather than table data.
Operational Notes
The extension has no runtime extension dependencies and needs no preload or restart. Its C library loads when the function is called. Creating the extension requires a superuser because the control file does not mark it trusted. It is relocatable and can be installed in a chosen schema or moved with ALTER EXTENSION colnames SET SCHEMA.
Release 1.7.1 documents PostgreSQL 8.2–17 compatibility. The PGSTY package targets PostgreSQL 14–18; PostgreSQL 18 acceptance comes from package and regression testing rather than that release’s compatibility statement.
PostgreSQL 9.3 and later also offer row_to_json with json_object_keys as a pure SQL alternative. If discovered names are used in dynamic SQL, quote identifiers and keep values parameterized.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)