From: Jaime Casanova <jcasanov@systemguards.com.ec>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ryan Bradetich <rbradetich@gmail.com>
Cc: pgsql-patches <pgsql-patches@postgresql.org>
Subject: Re: [PgFoundry] Unsigned Data Types [1 of 2]
Date: Sun, 7 Sep 2008 09:13:39 -0500
Message-ID: <3073cc9b0809070713s1df16d8dlb3be457b3584ba5c@mail.gmail.com> (raw)
In-Reply-To: <8731.1220773267@sss.pgh.pa.us>
References: <e739902b0808311335l1ad5d425r2704429c386f2f88@mail.gmail.com>
<3073cc9b0809061341q5c747488i85491e4c8e2420ba@mail.gmail.com>
<3073cc9b0809062330o62fd74dax74b1730cedc0fbb9@mail.gmail.com>
<8731.1220773267@sss.pgh.pa.us>
On Sun, Sep 7, 2008 at 2:41 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Jaime Casanova" <jcasanov@systemguards.com.ec> writes:
>> contrib_regression=# select * from t1 where f1 > 35;
>> ERROR: unsupported type: 16486
>
> 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. don't know what to suggest here? a
column in pg_type that identifies it? a hook?
switch (typid)
{
case BOOLOID:
return (double) DatumGetBool(value);
case INT2OID:
return (double) DatumGetInt16(value);
case INT4OID:
return (double) DatumGetInt32(value);
case INT8OID:
return (double) DatumGetInt64(value);
case FLOAT4OID:
return (double) DatumGetFloat4(value);
case FLOAT8OID:
return (double) DatumGetFloat8(value);
case NUMERICOID:
/* Note: out-of-range values will be clamped to +-HUGE_VAL */
return (double)
DatumGetFloat8(DirectFunctionCall1(numeric_float8_no_overflow,
value));
case OIDOID:
case REGPROCOID:
case REGPROCEDUREOID:
case REGOPEROID:
case REGOPERATOROID:
case REGCLASSOID:
case REGTYPEOID:
case REGCONFIGOID:
case REGDICTIONARYOID:
/* we can treat OIDs as integers... */
return (double) DatumGetObjectId(value);
}
/*
* Can't get here unless someone tries to use scalarltsel/scalargtsel on
* an operator with one numeric and one non-numeric operand.
*/
elog(ERROR, "unsupported type: %u", typid);
return 0;
--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
AsesorÃa y desarrollo de sistemas
Guayaquil - Ecuador
Cel. (593) 87171157
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: jcasanov@systemguards.com.ec, tgl@sss.pgh.pa.us, rbradetich@gmail.com
Subject: Re: [PgFoundry] Unsigned Data Types [1 of 2]
In-Reply-To: <3073cc9b0809070713s1df16d8dlb3be457b3584ba5c@mail.gmail.com>
* 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