Re: updates for handling optional argument in system functions

Mark Wong <markwkm@gmail.com>

From: Mark Wong <markwkm@gmail.com>
To: Andreas Karlsson <andreas@proxel.se>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2026-04-07T23:42:23Z
Lists: pgsql-hackers
On Wed, Apr 08, 2026 at 12:26:05AM +0200, Andreas Karlsson wrote:
> On 4/2/26 8:36 PM, Mark Wong wrote:
> > I've attached v5, simply a needed rebase due to some other churn in
> > pg_proc.dat.
> 
> Nice, I like the patch. The code changes looks good and I like the 
> removal of these duplicate functions and use of default arguments. But I 
> think the names of the arguments should be aligned with the names we 
> have in the documentation. And that may mean that we should change the 
> documentation.

Thanks!

> For example:
> 
> = Code
> 
> pg_get_ruledef(rule, pretty)
> 
> = Docs
> 
> pg_get_ruledef(rule_oid, pretty_bool)
> 
> = Should docs maybe be updated to the following?
> 
> pg_get_ruledef(rule oid, pretty bool)

I agree with the aligning the names, but maybe I was looking in a
different place?

In the doc/src/sgml/func/func-info.sgml (a4f774cf1c7e) I think I see
pg_get_ruledef(rule oid, pretty bool) already:

<function>pg_get_ruledef</function> ( <parameter>rule</parameter> <type>oid</type> <optional>, <parameter>pretty</parameter> <type>boolean</type> </optional> )


I don't see any matches when I grep for rule_oid or pretty_bool...

Regards,
Mark



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Simplify creation of built-in functions with default arguments.