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 1joY7M-0007LK-VX for pgsql-general@arkaria.postgresql.org; Thu, 25 Jun 2020 20:05:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1joY7L-0001BC-T7 for pgsql-general@arkaria.postgresql.org; Thu, 25 Jun 2020 20:05:03 +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 1joY7L-0001B5-LA for pgsql-general@lists.postgresql.org; Thu, 25 Jun 2020 20:05:03 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joY7I-0002jf-TF for pgsql-general@lists.postgresql.org; Thu, 25 Jun 2020 20:05:02 +0000 Received: from [80.187.80.218] (helo=[172.20.10.4]) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joY7G-0006DB-7A for pgsql-general@lists.postgresql.org; Thu, 25 Jun 2020 22:04:58 +0200 From: Matthias Apitz To: Subject: Re: error messages (autovaccum canceled and syntax errors) while =?iso-8859-1?Q?loading_a_DUMP?= Date: Thu, 25 Jun 2020 22:04:57 +0200 User-Agent: Dekko/0.6.20; Qt/5.4.1; ubuntumirclient; Linux; MIME-Version: 1.0 Message-ID: In-Reply-To: <2290032.1593114114@sss.pgh.pa.us> References: <20200625111137.GA15798@sh4-5.1blu.de> <20200625125402.GA27634@sh4-5.1blu.de> <20200625180329.GA19346@sh4-5.1blu.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 80.187.80.218 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thursday, 25 June 2020 21:41:54 CEST, Tom Lane =20 wrote: > 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? >=20 > 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... >=20 I have to check if the dump file was moved from one host to another, but=20 even if so, it was moved by scp. I think, that a gzip -dc foo will work, regardless of the file names extensiom not beeing .gz I think also, if the file have been corrupted on transport, gzip -dc ...=20 would complain about. matthias --=20 Sent from my Ubuntu phone http://www.unixarea.de/ NO to the EU! NEIN zur EU!