Other Functions
PG_GET_EXPR
Overview
The pg_get_expr
function retrieves the internal form of an individual expression, such as the default value for a column.
Syntax
There are two versions of the pg_get_expr
function:
Please see the breakdown of both versions:
-
expr_text
: The expression for which you want to obtain the internal representation. It can be any string value. -
relation_oid
: The OID (Object Identifier) of the table the expression belongs to. It is in integer type. -
pretty_bool
: A boolean value determining whether to format the expression in a more human-readable format (TRUE) or not (FALSE).
Output
Both versions of the pg_get_expr
function return an empty string ""
.
Example
- First, create a sample table named employees.
- Get OID of the table.
You will get the OID of the table:
- Retrieve the internal form for the
salary
column usingpg_get_expr
.
Both return the same value, an empty string ""
.