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.94.2) (envelope-from ) id 1qsLtk-007gDs-P5 for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Oct 2023 11:36:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qsLti-000KnJ-BF for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Oct 2023 11:36:35 +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.94.2) (envelope-from ) id 1qsLth-000KnB-9W for pgsql-hackers@lists.postgresql.org; Mon, 16 Oct 2023 11:36:34 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qsLtc-000xXu-GF for pgsql-hackers@lists.postgresql.org; Mon, 16 Oct 2023 11:36:33 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 057CE32009C0; Mon, 16 Oct 2023 07:36:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 16 Oct 2023 07:36:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1697456184; x= 1697542584; bh=fgLnsm/WoogY9kxMHvJsEL2Kcyaiy9VGeiqlgXHhq2E=; b=X qmBRyq96y8P/i451pN0XOFUJ3iEjuOhkSBTR9R80wgCRNNuBFPgrWU+FGFPyASJR wdmsxvnc9RBbe+813/lGjc40hjjrsoL6gIOX3zxsrcA4jfXXXniIyeS2jTaTEm5r Dh4eJyHKX3znkImAhMn8+hn5f3dMh2Zx1VAJ2J5jlpULHkMWUdd0NVFjkABBONNi E+OkbqJbJyz6GWtsesnxB2dBgN/42hi8UHOvFbKKD5cUWvObyUXwP5GddghFfEQ0 EF6KcdsQg+UpP1jznaeeVlmsIUdZ+1DuPY1Rd1Yg0ZJihrXfGVT2/qHLlTY672+P z3L7Zsw3llFGsiabEEqNw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjedtgdeflecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 Oct 2023 07:36:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1697456181; bh=8IV8uSuy1+/XSQU95msZ0mWDtTbS00KWXNhSEPJ9xzg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=lXtmkbVj0uqGg6OKdhKJth18Mt3Upo24FP3/6RmKtudllZyDRMDcvabEA5/6Rzyvn /bF4iiAuNPaE7z/+L8i3xKABhUS4E0yAcAjIu4Su46tBlLiwf9HS1iSkwDYa4DOz2d AmGGLRiSc7LFdsMeE/tj7CkbIK4OPzAYWi0Te1qssfOMuManzU8/AjXq9hK6O+LKrB 5oCMGyvbmcNwkpwMr9FxzAl1fx06cLxcOTCqR5gnZcUmFDsnSOcOT+fyhcjijutxrS 79ZJi/NECesnK8rEFpA2fGAdx1iTuiIRIu6pRBGxm1ZLv/qYHopQrcYw2AhCPOShNi 1dzDxcQQRRllg== Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 7B2DECF; Mon, 16 Oct 2023 13:36:21 +0200 (CEST) Date: Mon, 16 Oct 2023 13:36:21 +0200 From: Alvaro Herrera To: Nikita Malakhov Cc: "David G. Johnston" , Robert Haas , Tom Lane , PostgreSQL Hackers Subject: Re: Pro et contra of preserving pg_proc oids during pg_upgrade Message-ID: <202310161136.iswfvsuj7v3w@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-Oct-13, Nikita Malakhov wrote: > Textual representation requires a long text field because it could > contain schema, arguments, it is difficult and not effective to be > saved as part of the data, and must be parsed to retrieve function > oid. It is worse than that: the regproc textual representation depends on search_path. If you store the text now, the meaning could change later, depending on the search_path that applies at read time. Of course, the storage for OID is much shorter and not subject to this problem; but it is subject to the problem that it breaks if you drop and replace the function, which could happen for instance in an extensions upgrade script. I think a better way to store a function's identity is to store the 'identity' column from pg_identify_object(). It is fully qualified and you can cast to regprocedure with no ambiguity (which gives you an OID, if you need one). And it should upgrade cleanly. If you have a regproc column that you want to upgrade, maybe it would work to do 'ALTER TABLE .. SET TYPE TEXT USING' and turn the value into pg_identify_object().identity. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/