Re: psql terminates on first error

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: Holger Jakobs <holger(at)jakobs(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: psql terminates on first error
Date: 2023-03-02 13:45:08
Message-ID: 1402808643.90840.1677764708832@office.mailbox.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> On 02/03/2023 14:30 CET Holger Jakobs <holger(at)jakobs(dot)com> 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 - of
> >>>> course to continue reading) psql continued after first error.
> >>> Do you use PowerShell and pipe pg_dumpall into psql?  The first thing
> >>> that comes to my mind when reading Postgres+Windows is that PowerShell
> >>> up to version 5.1 converts stdout to UTF-16LE.  This already tripped 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
> reading back with psql from the file made no difference.

Try pg_dumpall with option -f instead of redirecting stdout:

pg_dumpall -f dump.sql
psql -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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2023-03-02 14:33:30 Re: psql terminates on first error
Previous Message Holger Jakobs 2023-03-02 13:30:52 Re: psql terminates on first error