Re: updates for handling optional argument in system functions

Andreas Karlsson <andreas@proxel.se>

From: Andreas Karlsson <andreas@proxel.se>
To: Mark Wong <markwkm@gmail.com>, Chao Li <li.evan.chao@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2026-02-18T21:56:56Z
Lists: pgsql-hackers
On 1/30/26 1:15 AM, Mark Wong wrote:
>> Thanks for the patch. After reviewing it, I have mixed feelings. From one side, it removes some redundant code, which is good. In the other side, I doubt if we should delete proc entries from pg_proc.c? Say, there is a view that uses a proc to be deleted, the proc OID is stored with the view, then after an upgrade, the view would be broken. From this perspective, should we retain the old proc entries and only point them to the new functions?
> 
> I don't have a solution for the case of a view storing the OID, but Álvaro
> Herrera suggested to me to at least try preventing those OIDs from being
> reused.
> 
> I've attached a v3 patch set that introduces src/include/catalog/pg_retired.dat
> to store previously used OIDs and procedure names that the scripts unused_oids
> and renumber_oids.pl can consume to prevent the reuse of retired OIDs.
> 
> Maybe that can also be used towards finding that particular solution...
I am not sure what can be done, breaking people's databases on 
pg_upgrade is certainly not nice and detecting that function oid has 
been used anywhere in a database sounds painful, especially since there 
are no references to system oids in pg_depend, right?

That said this patch should be updated to use the new support for 
default values in BKI files.[1]

https://git.postgresql.org/cgit/postgresql.git/commit/?id=759b03b24ce96f0ba6d734b570d1a6f4a0fb1177

Andreas



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.