Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxTJ4-0007r1-6M for pgsql-admin@arkaria.postgresql.org; Tue, 22 Nov 2022 13:27:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oxTJ1-0001Gh-4b for pgsql-admin@arkaria.postgresql.org; Tue, 22 Nov 2022 13:27:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxTJ0-0001GX-Nd for pgsql-admin@lists.postgresql.org; Tue, 22 Nov 2022 13:27:18 +0000 Received: from mail.unimaticaspa.it ([89.97.230.136]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxTIy-0002NQ-8m for pgsql-admin@lists.postgresql.org; Tue, 22 Nov 2022 13:27:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=unimaticaspa.it; s=mail; h=Message-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Bay687GPI1xN0m+AJraqQPZNF2khVNMwaZxbdYFVKv0=; t=1669123636; x=1670419636; b=ijC6N+T1yQtO6AYbI2ble+XR4rBhkCiWe3elXBBTL5ZgHrabjMsNp57AyFtDJ7OBq/fBdFGad93 hAuZv7+C7e9zu0P1/+vO/3DU39FOwNq0FVyQq0+wSGih0u0u1gM5/P+KHzO9WMeTTEKJAb5RiN0Pr dDh1u9Fg9kDh3YGFC9Fz05/qsJuKMpS4KoKM3t8gVV3TfaWdRKvKMo8JV13lGOU1kLpeNcpDF90Nz ZjQFtLa02L7bNqWxRcivg3VTljEJOWUvWnKfUhs/u0EthrG0Q08uhuBDN/ayTV6HoTEk4O30vczFX T9xRG6dz1FpOKOykKgr5rYj3dmv+7g6Ey5whVy5fCF4sbOrDc9/6BWXK9Gu+beYL5gEg+8MeC/v9X EpfbXWC0bWmNmpy4dWvQIyxViIjsbTrYTaMii5pTs67IPmNwKBG8DxiosK2pHCLBAXWFKHg0hb9L0 klDaUT9E8j0YMlvDnYUonwSbybX1Ep6QoV90zHtdjbXKmrX4mLJ4tJrnZ3E3jRTXrD0MSPYlSTqEN ArwTCAI46iIP0owSyZBDLLEaELVo9vcZ4RYcbqaE8S0qkI221svmdnZpfDAmQg0xegNb410/CwLBB FlQIKZw1GGZpFcJWqJPPYyo9J5fKNluQ9L+OBX+DMwEBBbJLVfDjsk2+tQmEfF7P9fVvs=; Received: from pc-ortensi-fisso.unimatica.lan ([10.143.90.127]) by mail.unimaticaspa.it with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oxTIr-0073TD-ER; Tue, 22 Nov 2022 14:27:09 +0100 Date: Tue, 22 Nov 2022 14:27:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: Out of memory error during pg_upgrade in big DB with large objects To: Tom Lane Cc: pgsql-admin@lists.postgresql.org References: <1ox9nq-005Lel-UF@unimaticaspa.it> <3215516.1669051820@sss.pgh.pa.us> From: Massimo Ortensi In-Reply-To: <3215516.1669051820@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Unimatica-LocalUser: true Message-Id: <1oxTIr-0073TD-ER@unimaticaspa.it> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I tried (even if vers 15 is not feasible at the moment as we tested only vers 14). It ended with the same Out of memory failure, just more quickly ( 1 hour instead of 12 hours) Il 21/11/2022 18:30, Tom Lane ha scritto: > Massimo Ortensi writes: >> I'm trying to upgrade a huge DB from postgres 10 to 14 >> This cluster is 70+ TB, with one database having more than 2 billion >> records in pg_largeobject >> I'm trying pg_upgrade in hard link mode, but the dump of databas schema >> phase always fails with >> pg_dump: error: query failed: out of memory for query result >> pg_dump: error: query was: SELECT l.oid, (SELECT rolname FROM >> pg_catalog.pg_roles WHERE oid = l.lomowner) AS rolname, (SELECT >> pg_catalog.array_agg(acl ORDER BY row_n) FROM (SELECT acl, row_n FROM > FWIW, this query was rewritten pretty substantially in v15. > It's still going to produce a row per large object, but it > should be a lot narrower because most of the ACL-wrangling > now happens somewhere else. I don't know if migrating to > v15 instead of v14 is an option for you, and I can't promise > that that'd be enough savings to fix it anyway. But it's > something to think about. > > regards, tom lane