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 1pXjFG-0000LP-VP for pgsql-admin@arkaria.postgresql.org; Thu, 02 Mar 2023 13:45:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pXjFE-0005so-Sm for pgsql-admin@arkaria.postgresql.org; Thu, 02 Mar 2023 13:45:16 +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 1pXjFE-0005se-I0 for pgsql-admin@lists.postgresql.org; Thu, 02 Mar 2023 13:45:16 +0000 Received: from mout-u-204.mailbox.org ([80.241.59.204]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXjFC-0001VD-5O for pgsql-admin@lists.postgresql.org; Thu, 02 Mar 2023 13:45:15 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4PSC5x3XxRz9sWT; Thu, 2 Mar 2023 14:45:09 +0100 (CET) Date: Thu, 2 Mar 2023 14:45:08 +0100 (CET) From: Erik Wienhold To: Holger Jakobs , pgsql-admin@lists.postgresql.org Message-ID: <1402808643.90840.1677764708832@office.mailbox.org> In-Reply-To: References: <572addf0-5116-cec0-77fb-9a0ba0161240@jakobs.com> <453307953.83682.1677760371729@office.mailbox.org> <1b41a19f-5672-e185-f3ec-df96c6dcbae7@gmx.net> Subject: Re: psql terminates on first error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Normal X-Rspamd-Queue-Id: 4PSC5x3XxRz9sWT List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 02/03/2023 14:30 CET Holger Jakobs wrote: > > Am 02.03.23 um 13:48 schrieb Thomas Kellerer: > > Holger Jakobs schrieb am 02.03.2023 um 13:44: > >>>> Only when using an option -c "\set ON_ERROR_STOP false" (plus -f - o= f > >>>> course to continue reading) psql continued after first error. > >>> Do you use PowerShell and pipe pg_dumpall into psql?=C2=A0 The first = thing > >>> that comes to my mind when reading Postgres+Windows is that PowerShel= l > >>> up to version 5.1 converts stdout to UTF-16LE.=C2=A0 This already tri= pped me > >>> up in past with pg_dump and psql. > >> No, it was in cmd.exe or in bash > > I find using pipes with the Postgres command line tools on Windows > > unreliable in general (including cmd.exe). So if you did use > > redirection/pips, try without. > > Whether I use pipes or writing stdout of pg_dumpall to a file and=20 > reading back with psql from the file made no difference. Try pg_dumpall with option -f instead of redirecting stdout: =09pg_dumpall -f dump.sql =09psql -f dump.sql Redirecting stdout to an intermediate file should have the same effect as piping to psql. And what error do you get from psql? -- Erik