Re: [HACKERS] user-defined numeric data types triggering ERROR: unsupported type - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] user-defined numeric data types triggering ERROR: unsupported type
Date
Msg-id 29012.1520196416@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] user-defined numeric data types triggering ERROR:unsupported type  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: [HACKERS] user-defined numeric data types triggering ERROR:unsupported type
List pgsql-hackers
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> On 03/04/2018 08:37 PM, Tom Lane wrote:
>> Oh, well, that was another problem I had with it: those tests do basically
>> nothing to ensure that we won't add another such problem in the future.

> I don't follow. How would adding new custom types break the checks? If
> someone adds a new type along with operators for comparing it with the
> built-in types (supported by convert_to_scalar), then surely it would
> hit a code path tested by those tests.

Well, I think the existing bytea bug is a counterexample to that.  If
someone were to repeat that mistake with, say, UUID, these tests would not
catch it, because none of them would exercise UUID-vs-something-else.
For that matter, your statement is false on its face, because even if
somebody tried to add say uuid-versus-int8, these tests would not catch
lack of support for that in convert_to_scalar unless the specific case of
uuid-versus-int8 were added to the tests.

> So perhaps the best thing we can do is documenting this in the comment
> before convert_to_scalar?

I already updated the comment inside it ...

            regards, tom lane


pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: perltidy version
Next
From: Andrew Dunstan
Date:
Subject: Re: Rewriting the test of pg_upgrade as a TAP test - take two