Re: Inconsistent Errors on Row Comparisons

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Inconsistent Errors on Row Comparisons
Date: 2009-06-30 18:18:02
Message-ID: 23239.1246385882@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"David E. Wheeler" <david(at)kineticode(dot)com> writes:
> Yeah, that was just an aside. I liked that I got different errors when
> there were different numbers of columns than when the data types of
> the columns disagreed. I'm not sure that SYNTAX ERROR is a great code
> for when the count disagrees, but at least it's distinct from the
> column data type error.

> And I'm going on SQLSTATE here because I'm doing exception handling in
> pl/PgSQL and want to handle the two errors differently.

So really what you're wishing for is that we treat different-numbers-of-
columns as a whole new SQLSTATE inside category 42. What's the argument
for needing to handle this differently from DATATYPE_MISMATCH?

> Okay. I'll have to see what I can do with SQLERRM then. But isn't it
> localized?

Yeah, it is. You don't really want code looking at that to decide what
to do, if you can possibly avoid it. It's intended for human consumption.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2009-06-30 18:27:20 Re: Inconsistent Errors on Row Comparisons
Previous Message David E. Wheeler 2009-06-30 18:12:45 Re: Inconsistent Errors on Row Comparisons