Re: Inconsistent Errors on Row Comparisons - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Inconsistent Errors on Row Comparisons
Date
Msg-id 23239.1246385882@sss.pgh.pa.us
Whole thread Raw
In response to Re: Inconsistent Errors on Row Comparisons  ("David E. Wheeler" <david@kineticode.com>)
Responses Re: Inconsistent Errors on Row Comparisons  ("David E. Wheeler" <david@kineticode.com>)
List pgsql-hackers
"David E. Wheeler" <david@kineticode.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


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: Inconsistent Errors on Row Comparisons
Next
From: "David E. Wheeler"
Date:
Subject: Re: Inconsistent Errors on Row Comparisons