From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] user-defined numeric data types triggering ERROR: unsupported type
Date: Sat, 03 Mar 2018 20:37:53 -0500
Message-ID: <11916.1520127473@sss.pgh.pa.us> (raw)
In-Reply-To: <b5cede7b-354b-83e6-ab1f-7a1bf8a232fa@2ndquadrant.com>
References: <b68441b6-d18f-13ab-b43b-9a72188a4e02@2ndquadrant.com>
<9389.1506003842@sss.pgh.pa.us>
<4b444362-4240-49e0-3523-724e5932b060@2ndquadrant.com>
<24767.1506180446@sss.pgh.pa.us>
<d526eb53-dbd6-d414-8e5d-21e644ce4549@2ndquadrant.com>
<14597.1520038563@sss.pgh.pa.us>
<42f4e37e-f923-6ea9-4172-cdec5a8c2d25@2ndquadrant.com>
<b5cede7b-354b-83e6-ab1f-7a1bf8a232fa@2ndquadrant.com>
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> Here is v2 of the fix. It does handle all the convert_to_scalar calls
> for various data types, just like the numeric one did in v1 with the
> exception of bytea.
Pushed with some adjustments.
> The bytea case is fixed by checking that the boundary values are
> varlenas. This seems better than checking for BYTEAOID explicitly, which
> would fail for custom varlena-based types. At first I've been thinking
> there might be issues when the data types has mismatching ordering, but
> I don't think the patch makes it any worse.
I didn't like this one bit. It's unlike all the other cases, which accept
only specific type OIDs, and there's no good reason to assume that a
bytea-vs-something-else comparison operator would have bytea-like
semantics. So I think it's better to punt, pending the invention of an
API to let the operator supply its own convert_to_scalar logic.
> I've also added a bunch of regression tests, checking each case. The
> bytea test it should cause segfault on master, of course.
I was kind of underwhelmed with these test cases, too, so I didn't
commit them. But they were good for proving that the bytea bug
wasn't hypothetical :-)
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, tomas.vondra@2ndquadrant.com
Subject: Re: [HACKERS] user-defined numeric data types triggering ERROR: unsupported type
In-Reply-To: <11916.1520127473@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox