Show schema in COPY error CONTEXT strings - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Show schema in COPY error CONTEXT strings
Date
Msg-id 20100502155031.GA8404@core.home
Whole thread Raw
Responses Re: Show schema in COPY error CONTEXT strings
List pgsql-hackers
Use case: when running a process that populates many inherited
tables across schemas, having one fail gives the unhelpful
error message:

ERROR:  invalid input syntax for integer: "abc"
CONTEXT:  COPY foo, line 1, column a: "abc"

Unhelpful because "foo" does not uniquely identifies the table
or statement in question, which was actually: COPY alpha.foo FROM STDIN;
where 'alpha' was one of scores of schemas being populated. This
patch changes the output to:

ERROR:  invalid input syntax for integer: "abc"
CONTEXT:  COPY alpha.foo, line 1, column a: "abc"

I had to change the initial table in test/regress/sql/copy2.sql
from a temp table to a real table, as I could not find an easy
way to represent a wild card temp schema name inside of the
test/regres/expected/copy2.out file.

--
Greg Sabino Mullane greg@endpoint.com
End Point Corporation
PGP Key: 0x14964AC8

Attachment

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pg_migrator to /contrib in a later 9.0 beta
Next
From: Bruce Momjian
Date:
Subject: Re: pg_migrator to /contrib in a later 9.0 beta