pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Another user error? [RESOLVING]
Date: Sun, 1 Nov 2020 21:10:53 +0100
Message-ID: <20201101201053.GA23387@hjp.at> (raw)
In-Reply-To: <alpine.LNX.2.20.2011011143560.21010@salmo.appl-ecosys.com>
References: <alpine.LNX.2.20.2011011050550.21010@salmo.appl-ecosys.com>
	<CAKFQuwYihqTxK3uSLuhauyGieT-F+8_gYgt0z5t458aXNCv0uA@mail.gmail.com>
	<alpine.LNX.2.20.2011011143560.21010@salmo.appl-ecosys.com>

On 2020-11-01 11:50:31 -0800, Rich Shepard wrote:
> On Sun, 1 Nov 2020, David G. Johnston wrote:
> > You encountered and asked on this exact same issue Friday...the advice in
> > that "Multi-row insert: error at terminal row." all still applies.
> 
> Which is why I did this file chunk-by-chunk.

Your chunk still seems to be 2105 lines long.

As others have already suggested, your best chance is bisection. 
Split that single 2000+ line insert into two inserts of 1000+ lines
each. If you are lucky, one of them will work and the other won't.
Then split the insert which doesn't work. Repeat until you either can
see and fix the error or until you are down to a single line.


> Re-doing this by portions I find psql reporting errors it did not report
> before. So, I keep re-running the command until it all works.

This is normal. PostgreSQL doesn't try to find all errors. If it finds
an error, it reports it and aborts the query. So if your statement
contains more than one error (which is quite likely in a statement over
2000 lines long), fixing one error will just show the next.

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (3+ messages)  latest in thread

Message-ID: <20201101201053.GA23387@hjp.at>
Permalink:  ../20201101201053.GA23387@hjp.at/
Also on:    postgresql.org/message-id/20201101201053.GA23387@hjp.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: hjp-pgsql@hjp.at
  Subject: Re: Another user error? [RESOLVING]
  In-Reply-To: <20201101201053.GA23387@hjp.at>
  References: <alpine.LNX.2.20.2011011050550.21010@salmo.appl-ecosys.com> <CAKFQuwYihqTxK3uSLuhauyGieT-F+8_gYgt0z5t458aXNCv0uA@mail.gmail.com> <alpine.LNX.2.20.2011011143560.21010@salmo.appl-ecosys.com> <20201101201053.GA23387@hjp.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox