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 1koBLM-0002TA-MB for pgsql-general@arkaria.postgresql.org; Sat, 12 Dec 2020 20:18:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1koBLK-00074D-IM for pgsql-general@arkaria.postgresql.org; Sat, 12 Dec 2020 20:18:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1koBLJ-000746-0c for pgsql-general@lists.postgresql.org; Sat, 12 Dec 2020 20:18:14 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1koBLG-00050h-2d for pgsql-general@lists.postgresql.org; Sat, 12 Dec 2020 20:18:12 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 05BD55E8; Sat, 12 Dec 2020 15:18:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sat, 12 Dec 2020 15:18:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=u JcOLYzDa69DRclXtd3qxKSBAG576acL5zFPrUiK5bE=; b=iJ3b0jvYwNgAc1rDR rd2zoXNi6oX1pPjkAevA+NnWpi+9F73kYImu/fW3DeZNbTeqQZW0fINXkkm37aNK c758hTPeVCS48rX9ls0cR0jGHI+iArfYvy1NzC1vQfdiIOX4idwuSW1kf5tsiLKF DTMK5lUFDQHGoGdSEjQZMLRfXazISvAuAbhW9IUaNT4K8R3Gzuu3dU8NpZ1K9/43 7StMptOvez1gPDFoqI9w3V+MLTK25pS7AhzxIgXzrXqJHfzPbjMzOVTlNFC8sz6r JuwiV7q2tPgdp28pDuKG0E/MtzQb4zAlQypQ6a8SCtY/rof5na0YQ4Y5l9YAqICH 26FfA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=uJcOLYzDa69DRclXtd3qxKSBAG576acL5zFPrUiK5 bE=; b=lGURXlLNJcifQQwz9U2QVevUIIgbIvk2axs/uSdPM5CzO7M8KJoCULRiG 6gTEo8bsyJ5cgK3KFeYud+/lI0l5qfBtYeckZY0p/AYPysiA8W59xikgkXGVWOXM FoLV0bZELyd06fU6mFB+wergRRlJDnpNNWmnByTZsG2vSNV9SdW9c6yR2cGkhiA9 /9M03tDe5id55JN4XxZw7um5spokTn+xG0RUfAwz0S+dFmR0j995H4W+fPZ+HFKG 7aBriYWVlbhKhCKNDXpboCJ40cyk2DEt4KuGldAlVv+HbkSMjlXZ+/m5p3Q3UQlO zU4ArN4foy9A9IQqe/xAF/yH9wqVg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudekgedgudefiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesth ekredttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeduudefje etveffhefgudehtdfhvdetkeeiueehfeevveduteekleeuheegudehhfenucffohhmrghi nhepphhoshhtghhrvghsqhhlrdhorhhgnecukfhppeejhedrudejvddruddrieelnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghn rdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.4] (75-172-1-69.tukw.qwest.net [75.172.1.69]) by mail.messagingengine.com (Postfix) with ESMTPA id B0F5F1080057; Sat, 12 Dec 2020 15:18:06 -0500 (EST) Subject: Re: pg_restore fails when psql succeeds To: Cherio , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: Date: Sat, 12 Dec 2020 12:18:05 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/12/20 12:10 PM, Cherio wrote: > I am facing a consistent issue with pg_restore when moving databases > with large tables from PostgreSQL 10 to 13. pg_restore fails to restore > indexes on some large tables (anything over 20 million records). > > pg_restore: error: could not execute query: ERROR:  out of memory > DETAIL:  Failed on request of size 214728704 in memory context > "TupleSort sort". > CONTEXT:  parallel worker > Command was: CREATE INDEX some_index_idx ON schema1.table1 USING btree > (some_field); > > This happens when a database is exported with formats "custom" or > "directory". No errors occur when the same databases are exported as > plain text and imported with psql. > > Initially I was importing with --jobs in several threads, but reducing > threads to 1 made no difference. I tried exporting with pg_dump versions > 13 and 10. It made no difference either - restore succeeds with plain > text + psql and fails with the other formats + pg_restore. > > The same doesn't happen when I import from 10 into 12. I am a bit lost > and concerned at this point about moving on with conversion to version 13. > > Any guidance would be greatly appreciated! Exact Postgres 13 version? Hardware specifications for machine? Changes in this section(https://www.postgresql.org/docs/13/runtime-config-resource.html) of postgresql.conf? Relevant information from system logs? -- Adrian Klaver adrian.klaver@aklaver.com