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: Fri, 02 Mar 2018 19:56:03 -0500
Message-ID: <14597.1520038563@sss.pgh.pa.us> (raw)
In-Reply-To: <d526eb53-dbd6-d414-8e5d-21e644ce4549@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>
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> OK, time to revive this old thread ...
>>> [ scalarineqsel may fall over when used by extension operators ]
> Attached is a minimal fix adding a flag to convert_numeric_to_scalar,
> tracking when it fails because of unsupported data type. If any of the 3
> calls (value + lo/hi boundaries) sets it to 'true' we simply fall back
> to the default estimate (0.5) within the bucket.
I think this is a little *too* minimal, because it only covers
convert_numeric_to_scalar and not the other sub-cases in which
convert_to_scalar will throw an error instead of returning "false".
I realize that that would be enough for your use-case, but I think
we need to think more globally. So please fix the other ones too.
I notice BTW that whoever shoehorned in the bytea case failed to
pay attention to the possibility that not all three inputs are
of the same type; so that code is flat out broken, and capable
of crashing if fed dissimilar types. We ought to deal with that
while we're at it, since (IMO) the goal is to make convert_to_scalar
fail-soft for any combination of supplied data types.
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: <14597.1520038563@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