pg.ddx.io  pgsql-patches@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jaime Casanova <jcasanov@systemguards.com.ec>
Cc: Ryan Bradetich <rbradetich@gmail.com>
Cc: pgsql-patches <pgsql-patches@postgresql.org>
Subject: Re: [PgFoundry] Unsigned Data Types [1 of 2]
Date: Sun, 07 Sep 2008 12:07:18 -0400
Message-ID: <14575.1220803638@sss.pgh.pa.us> (raw)
In-Reply-To: <3073cc9b0809070713s1df16d8dlb3be457b3584ba5c@mail.gmail.com>
References: <e739902b0808311335l1ad5d425r2704429c386f2f88@mail.gmail.com>
	<3073cc9b0809061341q5c747488i85491e4c8e2420ba@mail.gmail.com>
	<3073cc9b0809062330o62fd74dax74b1730cedc0fbb9@mail.gmail.com>
	<8731.1220773267@sss.pgh.pa.us>
	<3073cc9b0809070713s1df16d8dlb3be457b3584ba5c@mail.gmail.com>

"Jaime Casanova" <jcasanov@systemguards.com.ec> writes:
> On Sun, Sep 7, 2008 at 2:41 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> That obviously isn't supposed to happen.  Where's it coming from
>> exactly?

> convert_numeric_to_scalar() in src/backend/utils/adt/selfuncs.c

> the problem seems to be that we are asking for each type of numeric
> and of course that doesn't know nothing about unsigned integers so its
> treating it as a non-numeric.

Ah.  The scalarltsel/scalargtsel stuff has always been a bit bogus for
cross-type comparisons; it assumes it will know both or neither of the
two datatypes.  So you can get away with using those functions for
uint > uint (although they won't be very bright about it); but using
them for uint > int fails outright.

If you read the comments around that stuff it leaves quite a lot to be
desired, but I don't really have better ideas at the moment.  The best
near-term solution for the uint module is probably not to rely on
scalarltsel/scalargtsel for uint comparisons, but to make its own
selectivity functions that know the uint types plus whatever standard
types you want to have comparisons with.

			regards, tom lane



view thread (26+ messages)  latest in thread

Message-ID: <14575.1220803638@sss.pgh.pa.us>
Permalink:  ../14575.1220803638@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14575.1220803638@sss.pgh.pa.us

 · 

reply

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-patches@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jcasanov@systemguards.com.ec, rbradetich@gmail.com
  Subject: Re: [PgFoundry] Unsigned Data Types [1 of 2]
  In-Reply-To: <14575.1220803638@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