Re: Another user error? [RESOLVING] - Mailing list pgsql-general

From Peter J. Holzer
Subject Re: Another user error? [RESOLVING]
Date
Msg-id 20201101201053.GA23387@hjp.at
Whole thread Raw
In response to Re: Another user error? [RESOLVING]  (Rich Shepard <rshepard@appl-ecosys.com>)
Responses Re: Another user error? [RESOLVING]  (Rich Shepard <rshepard@appl-ecosys.com>)
List pgsql-general
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!"

Attachment

pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Re: Another user error? [RESOLVING]
Next
From: Rich Shepard
Date:
Subject: Re: Another user error? [RESOLVING]