Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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


pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group