Skip to content

describe_resultset

PostgreSQL extension to show names, data types, and attributes of columns in an arbitrary result set

describe_resultset · PostgreSQL extension to show names, data types, and attributes of columns in an arbitrary result set

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101333describe_resultsetdescribe_resultset1.0.0UTILMITC

Usage

Sources:

describe_resultset — This Postgres extension implements the “describe a result set” functionality, which, given a query or another PostgreSQL command that returns a result set, shows a list of columns in that result set, along with their respective data types and, possibly, other attributes. Use it for the corresponding SQL or database utility workflow. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.

Core Workflow

CREATE EXTENSION describe_resultset;

SELECT * FROM describe_resultset('select 1 as foo, 1.1 as bar')

Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.

Important Objects

  • describe_resultset(cmd TEXT) is an extension function and returns TABLE.
  • describe_resultset_internal(cmd TEXT) is an extension function and returns SETOF.
  • describe_resultset_data is an extension-defined type.

Requirements and Caveats

  • The reviewed control file declares default version 1.0.0.
  • The control file marks the extension as relocatable.
  • Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.

Table reader