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 1joXl5-0006bm-Rh for pgsql-general@arkaria.postgresql.org; Thu, 25 Jun 2020 19:42:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1joXl4-0000dP-5o for pgsql-general@arkaria.postgresql.org; Thu, 25 Jun 2020 19:42:02 +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 1joXl3-0000dI-Uc for pgsql-general@lists.postgresql.org; Thu, 25 Jun 2020 19:42:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joXl1-0006L2-89 for pgsql-general@lists.postgresql.org; Thu, 25 Jun 2020 19:42:01 +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 05PJfs4d2290033; Thu, 25 Jun 2020 15:41:54 -0400 From: Tom Lane To: Adrian Klaver cc: Matthias Apitz , pgsql-general@lists.postgresql.org Subject: Re: error messages (autovaccum canceled and syntax errors) while loading a DUMP In-reply-to: References: <20200625111137.GA15798@sh4-5.1blu.de> <20200625125402.GA27634@sh4-5.1blu.de> <20200625180329.GA19346@sh4-5.1blu.de> Comments: In-reply-to Adrian Klaver message dated "Thu, 25 Jun 2020 12:12:50 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2290031.1593114114.1@sss.pgh.pa.us> Date: Thu, 25 Jun 2020 15:41:54 -0400 Message-ID: <2290032.1593114114@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Adrian Klaver writes: > On 6/25/20 11:03 AM, Matthias Apitz wrote: >> I looked in the dump file after uncompressing it. The 'syntax error' >> comes from: one large table contains in a bytea column Perl code wich >> our software reads from the table and executes it with Perl. But, why >> the psql tryes to understand this code when it should INSERT it into the >> table? The perl fragment you show is similar to what's reported in the error message, but it doesn't quite match, so I'm not 100% sold on the theory that that's somehow not been quoted correctly. However, regardless of the exact details, it seems like the most likely theory about what is happening is that the dump file is corrupt and the corruption is causing the de-gzipped output to be missing or duplicating chunks of text. (Given the way gzip compression works, that wouldn't be a very surprising symptom.) So that leads me to wonder what was done to the dump file in between creation and use. One idea, seeing that the dump file was not given a ".gz" extension that would reflect its compressed state, is that something thought it was plain text and tried to do a newline conversion on it. If it was passed through email that would be a really plausible mechanism... regards, tom lane