pg_get_functiondef

pg_get_functiondef

ivorysql : Get function’s definition

Overview

ID Extension Package Version Category License Language
9170
pg_get_functiondef
ivorysql
1.0
SIM
Apache-2.0
C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-dt-
No
Yes
No
Yes
no
yes
Relationships
Siblings
ivorysql_ora
ora_btree_gin
ora_btree_gist
plisql
gb18030_2022

from contrib/pg_get_functiondef/pg_get_functiondef.control and package metadata

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
PIGSTY
1.0
18
17
16
15
14
ivorysql -
RPM
PIGSTY
5.1
18
17
16
15
14
ivorysql5 -
DEB
PIGSTY
5.1
18
17
16
15
14
ivorysql-5 -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
MISS
MISS
MISS
MISS
MISS
el8.aarch64
MISS
MISS
MISS
MISS
MISS
el9.x86_64
MISS
MISS
MISS
MISS
MISS
el9.aarch64
MISS
MISS
MISS
MISS
MISS
el10.x86_64
MISS
MISS
MISS
MISS
MISS
el10.aarch64
MISS
MISS
MISS
MISS
MISS
d12.x86_64
MISS
MISS
MISS
MISS
MISS
d12.aarch64
MISS
MISS
MISS
MISS
MISS
d13.x86_64
MISS
MISS
MISS
MISS
MISS
d13.aarch64
MISS
MISS
MISS
MISS
MISS
u22.x86_64
MISS
MISS
MISS
MISS
MISS
u22.aarch64
MISS
MISS
MISS
MISS
MISS
u24.x86_64
MISS
MISS
MISS
MISS
MISS
u24.aarch64
MISS
MISS
MISS
MISS
MISS

Source

Install

Make sure PGDG and PIGSTY repo available:

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

Install this extension with pig:

pig install ivorysql;		# install via package name, for the active PG version
pig install pg_get_functiondef;		# install by extension name, for the current active PG version

pig install pg_get_functiondef -v 18;   # install for PG 18

Create this extension with:

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 updated on