agora inbox for [email protected]
help / color / mirror / Atom feedFrom: Mark Wong <[email protected]>
Subject: [PATCH v4 4/6] Handle pg_get_constraintdef default args in system_functions.sql
Date: Tue, 9 Dec 2025 10:59:41 -0800
Modernize pg_get_constraintdef to use proargdefaults to handle the
optional pretty argument.
---
src/backend/utils/adt/ruleutils.c | 17 -----------------
src/include/catalog/pg_proc.dat | 6 ++----
2 files changed, 2 insertions(+), 21 deletions(-)
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index b40158d30bb..03550f0d80b 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -2062,23 +2062,6 @@ pg_get_partconstrdef_string(Oid partitionId, char *aliasname)
*/
Datum
pg_get_constraintdef(PG_FUNCTION_ARGS)
-{
- Oid constraintId = PG_GETARG_OID(0);
- int prettyFlags;
- char *res;
-
- prettyFlags = PRETTYFLAG_INDENT;
-
- res = pg_get_constraintdef_worker(constraintId, false, prettyFlags, true);
-
- if (res == NULL)
- PG_RETURN_NULL();
-
- PG_RETURN_TEXT_P(string_to_text(res));
-}
-
-Datum
-pg_get_constraintdef_ext(PG_FUNCTION_ARGS)
{
Oid constraintId = PG_GETARG_OID(0);
bool pretty = PG_GETARG_BOOL(1);
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 7e45cbcb93d..1d1b24a8f4c 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -3987,9 +3987,6 @@
{ oid => '1662', descr => 'trigger description',
proname => 'pg_get_triggerdef', provolatile => 's', prorettype => 'text',
proargtypes => 'oid', prosrc => 'pg_get_triggerdef' },
-{ oid => '1387', descr => 'constraint description',
- proname => 'pg_get_constraintdef', provolatile => 's', prorettype => 'text',
- proargtypes => 'oid', prosrc => 'pg_get_constraintdef' },
{ oid => '1716', descr => 'deparse an encoded expression',
proname => 'pg_get_expr', provolatile => 's', prorettype => 'text',
proargtypes => 'pg_node_tree oid', prosrc => 'pg_get_expr' },
@@ -8529,7 +8526,8 @@
proargdefaults => '{0,false}', prosrc => 'pg_get_indexdef' },
{ oid => '2508', descr => 'constraint description with pretty-print option',
proname => 'pg_get_constraintdef', provolatile => 's', prorettype => 'text',
- proargtypes => 'oid bool', prosrc => 'pg_get_constraintdef_ext' },
+ proargtypes => 'oid bool', proargnames => '{constraint,pretty}',
+ proargdefaults => '{false}', prosrc => 'pg_get_constraintdef' },
{ oid => '2509',
descr => 'deparse an encoded expression with pretty-print option',
proname => 'pg_get_expr', provolatile => 's', prorettype => 'text',
--
2.43.0
--eEEy3EHc57lA8spa
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v4-0005-Handle-pg_get_expr-default-args-in-system_functio.patch"
view thread (4340+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [PATCH v4 4/6] Handle pg_get_constraintdef default args in system_functions.sql
In-Reply-To: <no-message-id-553156@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox