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 1tOJBZ-005Uh9-JZ for pgsql-general@arkaria.postgresql.org; Thu, 19 Dec 2024 16:15:38 +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 1tOJBY-00EqXv-VX for pgsql-general@arkaria.postgresql.org; Thu, 19 Dec 2024 16:15:36 +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 1tOJBY-00EqXm-3e for pgsql-general@lists.postgresql.org; Thu, 19 Dec 2024 16:15:36 +0000 Received: from fout-b2-smtp.messagingengine.com ([202.12.124.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tOJBP-000bul-FT for pgsql-general@postgresql.org; Thu, 19 Dec 2024 16:15:35 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 99F221140147; Thu, 19 Dec 2024 11:15:25 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Thu, 19 Dec 2024 11:15:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1734624925; x=1734711325; bh=vfGsjEy3apAiB9j0JPuWJa/b+OSKqWaVVDQYHuuB66g=; b= LVahG5oGgy4NKz0A5eOPOdrBQ2jFwUt7OGIeMTzb4XuZB3uiOYmgEKotdTVXJdoD H59d8EMR3/2dxmYU5rzg9MLvp/UdjPFB2FZBcs3Hm6dzyJGbyHXBiqnkzfWx5BDG ITaiUmmd6bdopBzx6moDN9svkgQjzmXySIpBIvT6HHg1viASPUBlLA2LsN+jbegh RN7kuFrRlVy229hfKYfKNsLCOXUBNwGqr1VCO8VdyT8iZux33IJcpYWRJ9L1bOCb u5rlCz8XcrSFV6JmMjITecmN5LV2SO0qe9QNmvvEs2n27tE12KAgiZJP5S/4R3ul tifg9HmEVpbMaFp2SZotbw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1734624925; x=1734711325; bh=v fGsjEy3apAiB9j0JPuWJa/b+OSKqWaVVDQYHuuB66g=; b=bBxUT7/3HOVoTSGS6 PczRIXSqFTHokBRTRnn6KGW0lT1mABq6DJeJr9G81+Syn4GBB7WNRfmtP7wuExc0 g6rcmn45n+G9arFC4ogRjdluyhDaEyL7jyBraUpB1t5KkPepkg0+K3adZqoaIugP u96xYRhT/tZjoGMmI49+MmI/h+2NJ0G1PDTzK4bCTlatU0zcSo8uMJoaZsTgwmti WoLfvy36tXOLSzi6rhSdqtyv5jw8GJEI4uwevFMOjTYSyqU3zjTv38x1xUGJw5La GEtM/0WQauK9rtEMeIGU/zF471M+1F3TQMk8NP4xnmsKZ4P6KMyyZAyBnAiu0DJV nDFDg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddttddgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfg fuvfhfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghr uceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrth htvghrnhepieffteeujedtvdeileffffffffeivdekveetgeekgffgleejffduuddttdef jeejnecuffhomhgrihhnpehsqhhlrdhtohdpphhoshhtghhrvghsqhhlrdhorhhgnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghn rdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdpnhgspghrtghpthhtohepvddpmhhoug gvpehsmhhtphhouhhtpdhrtghpthhtoheprghrohhnshejsehgmhgrihhlrdgtohhmpdhr tghpthhtohepphhgshhqlhdqghgvnhgvrhgrlhesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Dec 2024 11:15:24 -0500 (EST) Message-ID: Date: Thu, 19 Dec 2024 08:15:24 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Issue with pg_dump due to Schema OID Error To: arons , pgsql-general@postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/19/24 01:43, arons wrote: > I forgot to attache the script. In MyTestBugSchema01.baseProc() you meant to have: select MyTestBugSchema.afunction( u.username ) instead of select MyTestBugSchema2.afunction( u.username ) In other words there is a predefined MyTestBugSchema? > > On Thu, Dec 19, 2024 at 10:41 AM Renzo Dani > wrote: > > Hi, > > > Recently, I encountered a problem during a database export using > pg_dump. > > > Here is the error message: > > > pg_dump: last built-in OID is 16383 > > pg_dump: reading extensions > > pg_dump: identifying extension members > > pg_dump: reading schemas > > pg_dump: reading user-defined tables > > pg_dump: reading user-defined functions > > pg_dump: error: schema with OID 41960442 does not exist > > > To investigate the issue, I ran the following query: > > > SELECT * FROM pg_proc WHERE pronamespace = 41960442; > > > The result: > > > oid;proname;pronamespace;proowner;prolang;procost;prorows;provariadic;prosupport;prokind;prosecdef;proleakproof;proisstrict;proretset;provolatile;proparallel;pronargs;pronargdefaults;prorettype;proargtypes;proallargtypes;proargmodes;proargnames;proargdefaults;protrftypes;prosrc;probin;prosqlbody;proconfig;proacl > > 41966618;remapprotocoltypeids;41960442;19214494;13547;100;0;0;-;f;f;f;f;f;v;u;1;0;25;25;;;{pprotocoltypeids};;; > > > I resolved the issue by removing the problematic record (admin > privileges required): > > > DELETE FROM pg_proc WHERE oid = 41966618; > > > This situation seems inconsistent and likely should not occur under > normal conditions. > > > While I’m unsure exactly when this issue originated in our > environment, I was able to reproduce it by performing concurrent > modifications on the schema. > > > To demonstrate, I wrote a bash script (test_bug.sh) that starts two > threads running in parallel. > > Each thread drops the schema with CASCADE and recreates it using the > SQL script search_bug.sql. > > > To use the script, you’ll need to adapt two variables at the > beginning of the script: PGPASSWORD and URL. > > > Using this script, I reproduced the problem on PostgreSQL versions > 16.1 and 17.1. > > It typically takes less than a minute to trigger the issue. > > The script terminates automatically as soon as the problem is detected. > > > Here are additional references that might be related to this issue: > > > https://www.postgresql.org/message-id/flat/20110209003823.GA93840%40mr-paradox.net > > https://www.postgresql.org/message-id/flat/BB8AF37F-E3D9-4DE0-B398-AF89748704F5%40bandwidth.com > > > > Let me know if you need additional information. > > > Best regards > > Renzo > -- Adrian Klaver adrian.klaver@aklaver.com