public inbox for [email protected]  
help / color / mirror / Atom feed
From: Mark Wong <[email protected]>
To: Tristan Partin <[email protected]>
Cc: [email protected]
Subject: Re: updates for handling optional argument in system functions
Date: Thu, 11 Jun 2026 07:47:37 -0700
Message-ID: <airKicKeRJaaoMF5@ltdrgnflg2> (raw)
In-Reply-To: <[email protected]>
References: <aTiwu9o8vBkLreAL@ltdrgnflg2>
	<ac63G6p1LAdbsca0@ltdrgnflg2>
	<[email protected]>
	<adWWX4jFbxib8oQ1@ltdrgnflg2>
	<[email protected]>
	<adaaL5VD9bfipZQI@ltdrgnflg2>
	<aiMuFBFYLAWQC_5Z@ltdrgnflg2>
	<[email protected]>

On Fri, Jun 05, 2026 at 09:04:34PM +0000, Tristan Partin wrote:
> > 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.

Oops, v8.1 attached to correct that white space.

> 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.

I believe that's handled in InsertOneProargdefaultsValue() in
src/backend/bootstrap/bootstrap.c, right below the comment:

   /* The values should correspond to the last N argtypes */

Regards,
Mark


view thread (18+ 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], [email protected], [email protected]
  Subject: Re: updates for handling optional argument in system functions
  In-Reply-To: <airKicKeRJaaoMF5@ltdrgnflg2>

* 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