pg_get_functiondef

Get function’s definition

Overview

PackageVersionCategoryLicenseLanguage
ivorysql1.0SIMApache-2.0C
IDExtensionBinLibLoadCreateTrustRelocSchema
9140ivorysql_oraNoYesNoYesNoNosys
9150ora_btree_ginNoYesNoYesYesNosys
9160ora_btree_gistNoYesNoYesYesNosys
9170pg_get_functiondefNoYesNoYesYesNo-
9180plisqlNoYesNoYesYesNopg_catalog
9190gb18030_2022NoYesNoYesYesNopg_catalog

from contrib/pg_get_functiondef/pg_get_functiondef.control and package metadata

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY1.01817161514ivorysql-
RPMPIGSTY5.11817161514ivorysql5-
DEBPIGSTY5.11817161514ivorysql-5-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
el8.aarch64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
el9.x86_64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
el9.aarch64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
el10.x86_64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
el10.aarch64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
d12.x86_64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
d12.aarch64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
d13.x86_64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
d13.aarch64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
u22.x86_64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
u22.aarch64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
u24.x86_64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
u24.aarch64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS

Install

You can install ivorysql directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

pig repo add pgsql -u          # Add repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install ivorysql;          # Install for current active PG version
pig ext install -y ivorysql -v 18  # PG 18
dnf install -y ivorysql5       # PG 18
apt install -y ivorysql-5   # PG 18

Create Extension:

CREATE EXTENSION pg_get_functiondef;

Usage

pg_get_functiondef: Get function’s definition

The pg_get_functiondef extension provides functions to retrieve the complete definition (DDL) of PostgreSQL functions and procedures, particularly useful in Oracle compatibility contexts within IvorySQL.

Enabling

CREATE EXTENSION pg_get_functiondef;

Retrieving Function Definitions

-- Get the DDL of a function by OID
SELECT pg_get_functiondef(oid) FROM pg_proc WHERE proname = 'my_function';

-- Get function definition by name
SELECT pg_get_functiondef('my_function'::regproc);

This extension extends the built-in pg_get_functiondef() to support Oracle-compatible function and procedure syntax used by IvorySQL, including PL/iSQL procedure bodies and Oracle-style parameter declarations.


Last Modified 2026-03-12: add pg extension catalog (95749bf)