Re: Inconsistent Errors on Row Comparisons

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

On Tue, Jun 30, 2009 at 11:27:20AM -0700, David Wheeler wrote:
> On Jun 30, 2009, at 11:18 AM, Tom Lane wrote:
>
>> 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?
>
> For my results_eq() in pgTAP, it could output different diagnostics. I'm
> already doing this for the set_eq() function I wrote, which uses EXCEPT.
> For that function, if you pass two statements with different numbers of
> columns, pgTAP says:
>
> # Failed test 148
> # Number of columns differs between queries
>
> While for a call with the same numbers of columns but different data
> types (say int,text and inet,text), pgTAP says:
>
> # Failed test 149
> # Column types differ between queries
>
> Essentially, while on a row object-level, they are different types, the
> caller of my function doesn't know that it's comparing rows, just that
> it's comparing result sets. So I like to give as much information as
> possible about the difference in the result sets of the queries. Hell,
> ideally it'd actually say something like:
>
> # Failed test 148
> # Number of columns differs between queries
> # have: 4 columns
> # want: 3 columns

Shouldn't that just read:

have: (int, int, text, point)
want: (int, int, text)

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-06-30 19:01:41 Re: 8.5 development schedule
Previous Message Tom Lane 2009-06-30 18:48:26 Re: Inconsistent Errors on Row Comparisons