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 1uWeSD-00GvYB-Ap for pgsql-admin@arkaria.postgresql.org; Tue, 01 Jul 2025 17:07:33 +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 1uWeSB-00789U-9k for pgsql-admin@arkaria.postgresql.org; Tue, 01 Jul 2025 17:07:31 +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 1uWeSA-00789K-UK for pgsql-admin@lists.postgresql.org; Tue, 01 Jul 2025 17:07:31 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uWeS9-0058Kh-1g for pgsql-admin@lists.postgresql.org; Tue, 01 Jul 2025 17:07:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 561H7QU63248811; Tue, 1 Jul 2025 13:07:26 -0400 From: Tom Lane To: Nikhil Shetty cc: Laurenz Albe , Pgsql-admin Subject: Re: pg_upgrade failure due to dependencies In-reply-to: References: <396f2fb636248f329c152c6eca189f4348fec726.camel@cybertec.at> <3165866.1751383802@sss.pgh.pa.us> Comments: In-reply-to Nikhil Shetty message dated "Tue, 01 Jul 2025 21:49:20 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3248809.1751389646.1@sss.pgh.pa.us> Date: Tue, 01 Jul 2025 13:07:26 -0400 Message-ID: <3248810.1751389646@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nikhil Shetty writes: > Yes both the extension and function are created by the extension but when > restoring, extension and associated functions or tables are created > separately and in different order . Ah, right, I'd momentarily forgotten that binary-upgrade mode dumps the extensions' contents as separate objects. I think that switching the function(s) to new-style syntax, as already mentioned, might get you pretty far. It'd be enough for pg_dump to get the function-vs-spatial_ref_sys-existence ordering right at least. What it will not do is ensure that the *contents* of spatial_ref_sys are restored early. But I'm not sure that that's fatal in a binary-upgrade situation, because we're not dumping/restoring data: the tables' disk files are just moved verbatim. There might still be some edge cases that fail, but I think basic scenarios ought to work. regards, tom lane