Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vT78n-00DMBX-2d for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 23:29:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vT78m-008WlV-0O for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 23:29:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vT78l-008Wl7-2S for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 23:29:08 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vT78j-00497E-16 for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 23:29:07 +0000 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-340ba29d518so4072555a91.3 for ; Tue, 09 Dec 2025 15:29:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765322943; x=1765927743; darn=lists.postgresql.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=UtI5xbixXHFgo5jR+2Rr0Eth52d2hiKZe18eU26Jgis=; b=ERET3lIAm6Pw/V5LgnJl1zzsvw1sOSK6lQAimDaq08ZGwB0vcfEoulL9Ww78gowhVI goQ/guMtdhpYh66h2RKjYtyA+n+HOm8OdhArTv6nHp+7MaOteWLC8jEx6lXdhkrFz+XL B1CSTgguyylAjOmNXI5IvlF1yJj8do2ZMD+JpZL0joBp1dzQedC+gBDeM8EG8aijdJwE IpBi3Ao5qJ6dFEqIqx3gEE5h45K4x6mEI9IftF937rQkMAE4yuGDiNmIAZkOjIMbzQHB 85gs3+PJkTv8EaPjnBcU9mMCeud0fRiQsNawXJtptvi10/igv61+YTTHS942nj8498MD l7Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765322943; x=1765927743; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UtI5xbixXHFgo5jR+2Rr0Eth52d2hiKZe18eU26Jgis=; b=AQsGjvueMwscCZ5GznVn2sOg23JMc3wrsp0hPtRq3nyZBRlbRne0oms5liayWKN0xJ Srd+R8Es92qrpfW+tRQjP3eZ3IPebXCrEVkyJ6fKj/2L+yWTPQHt+pReV1q2nwDhMq8T tUZZ0YhhFVQ1zCjPcd3jlkSW6DsqQ20fXKEUypGdQrK2Eqyp1+kb6fRcfn69IA6Hr//9 9CSGTY9OeBmI1O2ZUfhygKyyAu2C72VkyIpDnUDrDsMpBN09EwLbe7kfNyXTFgGD7Ap6 UmshzXmjavLbn11h2NCFffd5aNgmhsYpQc9xQvu88wZNKexKSIEbSD0M9kUlNtwyr1Up ruEw== X-Gm-Message-State: AOJu0YxSnK6MJCfDHyugRiv6KLZd7SJ8TIOPfvXRv+2ba0WpRsPmRTq1 5SjxVMkTFux7L+hZR/93legigsnwFxkIk3z3EsK+BojWynmnPO9bWETXeUvWyATS X-Gm-Gg: ASbGncvnIOjCLt8caN03F4BTIH9TymS9NwN8dJZ7BoA5M1xyfdNWhr2hE50EE2mvNch gx1twjypfp/IvaIs146mVuOwKTfMWzmbg9Cp3se/7gneVFqh87TDetajl9x/M0uH/mHwykwzZD3 3cMtoMNKWDmMqVaa40gB8w+7Ejgv6cSJRsYY4FM9bHViDKReGW0R9JaJoINjKxW/1/ksfkm6X32 SOgCtysyRDoNB0iC1VUKLsxcWhO3y5HqElqtz+Rq8dNnk+1+nqX3u7ID6Sodhznk32oWuupcoYm j2x+riBf16nWbv13SH76FrYRp0vE613XEhtzwypjkC+0wlZ2wuWgKAllC0edg6yjMRJYa9qHSs8 tNCjGOTkm5NFpBE1POlDViUfOd5/SvURmxnUARKelIthfA0btxPINwAQBrM7Xhk1BfmOJ/Im1ER yR9sa6SUX1fOfHTYcR1XzIVGa5UVmhr/Y= X-Google-Smtp-Source: AGHT+IERiY9+0adMkKYyQQqRBlAtogpeZ29HklwbnHiV5DtQemFp3ei/hu779g+J7VKULze0vbJJPQ== X-Received: by 2002:a05:7022:69a0:b0:11d:f44d:401d with SMTP id a92af1059eb24-11f29696b8emr339042c88.22.1765322942658; Tue, 09 Dec 2025 15:29:02 -0800 (PST) Received: from ltdrgnflg2 (71-34-92-171.ptld.qwest.net. [71.34.92.171]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11df7552211sm79924191c88.1.2025.12.09.15.29.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Dec 2025 15:29:01 -0800 (PST) Date: Tue, 9 Dec 2025 15:28:59 -0800 From: Mark Wong To: pgsql-hackers@lists.postgresql.org Subject: updates for handling optional argument in system functions Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="IRGsBYp1UN8d6WrT" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --IRGsBYp1UN8d6WrT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi everyone, I noticed how it was preferred to define optional arguments with the system functions in system_functions.sql instead of defining them in pg_proc.dat. I took a gross stab at updating the ones that ended in _ext, which turned out to be 7 declarations across 6 system functions, and created a patch per system function, hoping it would be easier to review. Perhaps the most interesting thing to share is the total reduction of the lines of code, although system_functions.sql only grows: src/backend/catalog/system_functions.sql | 49 ++++++++ src/backend/utils/adt/ruleutils.c | 130 ---------------------- src/include/catalog/pg_proc.dat | 36 ++---- 3 files changed, 56 insertions(+), 159 deletions(-) Is that something we want? Regards, Mark -- Mark Wong EDB https://enterprisedb.com --IRGsBYp1UN8d6WrT Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v1-0001-Handle-pg_get_ruledef-default-args-in-system_func.patch