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 1w0Win-001ypM-1i for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Mar 2026 03:28:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0Wil-00D5Tu-31 for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Mar 2026 03:28:24 +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 1w0Wil-00D5Tm-2A for pgsql-hackers@lists.postgresql.org; Thu, 12 Mar 2026 03:28:24 +0000 Received: from mail-dy1-x1333.google.com ([2607:f8b0:4864:20::1333]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w0Wih-00000002Eti-3Dkk for pgsql-hackers@lists.postgresql.org; Thu, 12 Mar 2026 03:28:23 +0000 Received: by mail-dy1-x1333.google.com with SMTP id 5a478bee46e88-2be1d9c356cso1001390eec.0 for ; Wed, 11 Mar 2026 20:28:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773286098; x=1773890898; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=mdUgUyRbk5hv4tcPOuyqGTEBQGNG8jLGUQxgZ6JTcp4=; b=VxAbjVF099RYE3cSWPraTvo7/rQWlmbX1gbI4auCHGEiV61Cg0RG904RVq46LvPpjg /PG1JLaotUv2JVkGDTCzN+yIpjM91stUz+YCVvefU1sMROz86QEdMQqr8kVZR2YKuiTu +q+iwHJCH/nvuiRQAYDxUpML6O98IVBKV8OUtj/lpZZdESfEmYiKgVsh2C/h+TahsClq /H6rQjQBYM3Qhquy2Jz5rtihlw5RgSA+dFKaQbIxCZLtkwjOLuMeRtccnP0q9ycewEXw bdRstQcWbzBc5krlWxNAcrLeOJ4Y4gydjgS0q696LLNSS/d++CZVhZN3zc7T8l6L+Pbk KE9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773286098; x=1773890898; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mdUgUyRbk5hv4tcPOuyqGTEBQGNG8jLGUQxgZ6JTcp4=; b=mzUHq8TMoyuaebu4lv1pDk6UUHwW6cWrwZw/NKydeGB2QfAcQhe6GCIydeSByHFAN3 xlmcJ5aHHH1+KZW5pYkIh9LLt8+HwhAqhIhamKDGQ5YyjBghl2YOydTGG0KxK2PsY/g8 wf0M7pTn0Wpdls92e88RR75tZl3h/ab+GO9EXftACdXyGAXc86A1VkW13the8m9YxRRb Ha2WPsjisjglsfp09vER+ANbqsiA/B3aQ8gQnSgaMNLJhCUND5nz4Pw2gBTRYmrI6y1L 08fK6SPNZZFOJpkVPYCuoS1et3rHMt4VZxmuZcxZS5ARw6thgdd1qSH5kcherhoE+gB4 D9pw== X-Forwarded-Encrypted: i=1; AJvYcCWZVtLnI8Gt0uAZ8rMFQSqa3R5lzDb4Rd9VFx5spmYJpiqLvYoUSLNDwgV7arQSBHtCssoOSuV7VYdsLHYZ@lists.postgresql.org X-Gm-Message-State: AOJu0YxITpy7CA/LQ+ds83A5Sss8stYjx2IrQW7cFv8VFAhrNxMWWhHW 1RXzijBaHH3Cn9P/Exj+RBVYt3Jav6D2F1hfjlD8pIa1il3gWyjngz4q X-Gm-Gg: ATEYQzz9Tdnl0GUxakdHv0GAV26QewH2xvX0XEwV6zgncXfLdZjOKA3fb4I5PD6+Qok AKSzUaRLEOutrsV0Qmax7zpFuuWLlRQPEvh89BFVk9CSgPfHoCHiBBrofhcaltWMscRntMWCxcV aLBpLQgJbzzRfbpNRboSTvA7IWkf4HXGjDCydK6zL0koZ52d4Ce9tnaRLpG4N+mpWp0tujcakmc Dyk4h5BrzdgC8C06MUCNy7XvSYMWcf/moYrhvQnw4Ab0rjzQwfxXTIC5jAF1zpMla3MfAKDk4VL PQDnJtqLGkxX9TeaIvDsAbtOIpuiLylVjPFsBUSE9pa79QJTBmdvmpZpG9sXqzFTKvsuuJo2Az8 X4htHYMNeBtjQUsUGA82aiTPNmT89L8RyzNfUNSMiivjCe3RYAhyCgh6u2eLdRX58856gQnBs5i Bb3hr0qxRe0RWraAgchl6hi2B+CwX9evVMLAAYk8mUIg== X-Received: by 2002:a05:7300:8803:b0:2be:fe8:8afc with SMTP id 5a478bee46e88-2be8a5863abmr1867384eec.27.1773286097675; Wed, 11 Mar 2026 20:28:17 -0700 (PDT) Received: from o (71-34-92-171.ptld.qwest.net. [71.34.92.171]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2be8a83514asm5134390eec.4.2026.03.11.20.28.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2026 20:28:17 -0700 (PDT) Date: Wed, 11 Mar 2026 20:28:14 -0700 From: Mark Wong To: =?iso-8859-1?Q?=C1lvaro?= Herrera Cc: Chao Li , pgsql-hackers@lists.postgresql.org Subject: Re: updates for handling optional argument in system functions Message-ID: References: <202603031619.ih6a6v4k6hd6@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202603031619.ih6a6v4k6hd6@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Mar 03, 2026 at 05:23:58PM +0100, Álvaro Herrera wrote: > On 2026-Jan-29, Mark Wong wrote: > > > 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. > > Thinking about this again, I wonder where did we get the idea that > reusing OIDs would be a problem. How exactly would this happen? When > you pg_upgrade, your views are taken from a `pg_dump --binary-upgrade` > of the original server, and then recreated using the text > representation of the DDL. We don't pass the function OIDs in any way > from the old server to the new server. And there's no other way (than > pg_upgrade) to go from one major version to the next one where the OID > has been reused. > > So why did we think this was an actual problem? I'm not sure. I think I see the OID of a function get used in some places likes rewriteDefine.c and parse_funcs.c, but I'm not sure if I see a function OID get written out and re-read for a function name lookup in an upgrade code path, yet... Regards, Mark -- Mark Wong EDB https://enterprisedb.com