Re: updates for handling optional argument in system functions

From: "Tristan Partin" <tristan(at)partin(dot)io>
To: "Mark Wong" <markwkm(at)gmail(dot)com>
Cc: <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: updates for handling optional argument in system functions
Date: 2026-06-05 21:04:34
Message-ID: DJ1F5L6XMENK.ABIOKCQQQ0FZ@partin.io
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Patch 1
>
> - proargtypes => 'oid bool', prosrc => 'pg_get_ruledef_ext' },
> + proargtypes => 'oid bool', proargnames => '{rule,pretty}',
> + proargdefaults => '{false}',prosrc => 'pg_get_ruledef' },

There is a space missing before prosrc in the added line.

Other than that one comment, this looks good to me.

I am a little confused how proargdefaults works given the function takes
two arguments, but you only defined one default, so how does the parser
know that the false default is in reference to "pretty". I do see there
is other precedent for this pattern, so it is correct.

--
Tristan Partin
PostgreSQL Contributors Team
AWS (https://aws.amazon.com)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-06-05 21:05:07 Re: Remove the refint contrib module (for v20)
Previous Message Tristan Partin 2026-06-05 20:46:00 Re: dict_synonym.c: fix truncation of multibyte sequence