Re: Inconsistent Errors on Row Comparisons

Поиск
Список
Период
Сортировка
От David Fetter
Тема Re: Inconsistent Errors on Row Comparisons
Дата
Msg-id 20090630185415.GQ21081@fetter.org
обсуждение исходный текст
Ответ на Re: Inconsistent Errors on Row Comparisons  ("David E. Wheeler" <david@kineticode.com>)
Ответы Re: Inconsistent Errors on Row Comparisons  ("David E. Wheeler" <david@kineticode.com>)
Список 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@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Inconsistent Errors on Row Comparisons
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 8.5 development schedule