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 1tOJNk-005VoI-Ak for pgsql-general@arkaria.postgresql.org; Thu, 19 Dec 2024 16:28:12 +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 1tOJNj-00Ezdz-8B for pgsql-general@arkaria.postgresql.org; Thu, 19 Dec 2024 16:28:10 +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 1tOJNi-00Ezdq-PP for pgsql-general@lists.postgresql.org; Thu, 19 Dec 2024 16:28:10 +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 1tOJNe-000c0m-M6 for pgsql-general@postgresql.org; Thu, 19 Dec 2024 16:28:09 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 879371140148; Thu, 19 Dec 2024 11:28:05 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Thu, 19 Dec 2024 11:28:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc: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=1734625685; x=1734712085; bh=X0ebuyxtnRDKlDSAnoPjMwLwowmJJP1LHflYYDPM2CY=; b= Owu4oRhGrrEWtJUzxCSR4nyFESV0WA0yISF2KsEHU+zogqqug0bedzc/sHroBiQK ZfuoZuRKxjT96dKMJmJQRjVxh8WWVjSqk0Zmktg+/pMGyNNaS1UTVoQ5ZnRVrT5w TcnQ0saV5vdinvkZLVwt+RdvKn/8RCJP2R+zc+3Ez+QtW8IODWgNM7TARCDnVL/J s/mW/iGpLWFG7Hu7xOpg6xaj4kbxlUy/3np56iyX82lFxbev9iBdJhnLv4k28wNy ekCu0qT86Ob/8Y9A85bzneaIy2SaKbMZ5P8ayH8JqmUpbSloYyq9e2PKqr2M8oSR qBTmELKT/NCyi5z0337UZQ== 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 :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1734625685; x= 1734712085; bh=X0ebuyxtnRDKlDSAnoPjMwLwowmJJP1LHflYYDPM2CY=; b=R qq/pF6Db09+F5j2jRYkUp1ndk18nYGei9Y/EwIWuHtewVG9etYwh/WEdKADeUrMd a5MU+JwZ8uBSFcBKymZzNhnWileR1Rt+uthTJHVi49IQgahfs9icgwJZtrAcVRfx 1btM4MaFtR1JXUqH49tdGddmhrfaI5MvW6/XmEPuI9UKC+rBjiJcR74pUo2ddLy1 4+rVoGVNe4E3gx+61oTdmkGvg6AXmp8CNigHuojYDrfmTtzbi6CiJZh38shwdQnE Cc8OPeNJHRghqMyak/txQJ5SZotaF4wusx7+P1geFTCpjVRFq7b1W/IhI7qwQcdI Zs2wACDv5cRO8skklAr2A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddttddgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfg fuvfhfvefhjggtgfesthekredttddvjeenucfhrhhomheptegurhhirghnucfmlhgrvhgv rhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrg htthgvrhhnpedvffelhfeuhfefjefhgfeijeekteelfedvieeuudeguddtueffhfdtfeek ueejjeenucffohhmrghinhepshhqlhdrthhopdhpohhsthhgrhgvshhqlhdrohhrghenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgr nhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsggprhgtphhtthhopedvpdhmoh guvgepshhmthhpohhuthdprhgtphhtthhopegrrhhonhhsjeesghhmrghilhdrtghomhdp rhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlsehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Dec 2024 11:28:04 -0500 (EST) Message-ID: Date: Thu, 19 Dec 2024 08:28:04 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Issue with pg_dump due to Schema OID Error To: Renzo Dani References: Content-Language: en-US Cc: pgsql-general 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 08:21, Renzo Dani wrote: Reply to list also. Ccing list. > HI Adrian, > you are right, there is a typo, the correct would be to have: >  MyTestBugSchema2.afunction( u.username ) > > In any case the problem appears in my tests also with that script. To be clear the test script did not use MyTestBugSchema2.afunction( u.username ) but instead MyTestBugSchema.afunction( u.username ). If that is the case where did MyTestBugSchema come from? > I think the execution is not really important, I suppose what create the > problem is the drop cascade of the schema. It is important if someone wants to replicate the test case. > > BR > Renzo > > On Thu, Dec 19, 2024 at 5:15 PM Adrian Klaver > wrote: > > 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 > -- Adrian Klaver adrian.klaver@aklaver.com