Re: Show schema in COPY error CONTEXT strings

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Show schema in COPY error CONTEXT strings
Date: 2010-05-03 16:43:09
Message-ID: 8dc3a9dcc8af8b37ef3271915b7ad3f9@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

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

> We're really not going to address this type of complaint on a
> one-error-message-at-a-time basis. See prior discussions --- a more
> realistic (and standards compliant) approach will probably involve
> adding fields to the verbose form of the error message.

Pointers to previous discussions welcome. I was simply trying to
fix a specific problem I was having, but some digging shows the
problem is already solved for most (all?) other similar cases:

# insert into public.foo (id) values ('mm');
ERROR: invalid input syntax for integer: "mm"
LINE 1: insert into public.foo (id) values ('mm');

# update public.foo set id='mm';
ERROR: invalid input syntax for integer: "mm"
LINE 1: update public.foo set id='mm';

# delete from public.foo where id = 'mm';
ERROR: invalid input syntax for integer: "mm"
LINE 1: delete from public.foo where id = 'mm';

Yes, I realize those are technically different context cases, but
from an application point of view, the COPY case is wrong and
needs fixing.

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201005031242
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkve/PoACgkQvJuQZxSWSsjHiQCgoPZMcnP9viWoo4KY3y/I5NiA
1N0AoNyd5Fhs8M9WRkQ1LAS58Kz8x72S
=aIY9
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2010-05-03 16:48:58 Re: max_standby_delay considered harmful
Previous Message Tom Lane 2010-05-03 16:38:29 Re: missing file in git repo