Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 7C17F64FD0A for ; Sun, 7 Sep 2008 11:13:44 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 67430-03 for ; Sun, 7 Sep 2008 11:13:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.230]) by postgresql.org (Postfix) with ESMTP id C3C2864FCDF for ; Sun, 7 Sep 2008 11:13:41 -0300 (ADT) Received: by rv-out-0506.google.com with SMTP id b25so1555987rvf.43 for ; Sun, 07 Sep 2008 07:13:40 -0700 (PDT) Received: by 10.141.162.1 with SMTP id p1mr8103158rvo.161.1220796819957; Sun, 07 Sep 2008 07:13:39 -0700 (PDT) Received: by 10.141.51.11 with HTTP; Sun, 7 Sep 2008 07:13:39 -0700 (PDT) Message-ID: <3073cc9b0809070713s1df16d8dlb3be457b3584ba5c@mail.gmail.com> Date: Sun, 7 Sep 2008 09:13:39 -0500 From: "Jaime Casanova" To: "Tom Lane" Subject: Re: [PgFoundry] Unsigned Data Types [1 of 2] Cc: "Ryan Bradetich" , pgsql-patches In-Reply-To: <8731.1220773267@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <3073cc9b0809061341q5c747488i85491e4c8e2420ba@mail.gmail.com> <3073cc9b0809062330o62fd74dax74b1730cedc0fbb9@mail.gmail.com> <8731.1220773267@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/85 X-Sequence-Number: 7100 On Sun, Sep 7, 2008 at 2:41 AM, Tom Lane wrote: > "Jaime Casanova" writes: >> contrib_regression=3D# 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_overfl= ow, 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 o= n * an operator with one numeric and one non-numeric operand. */ elog(ERROR, "unsupported type: %u", typid); return 0; --=20 Atentamente, Jaime Casanova Soporte y capacitaci=F3n de PostgreSQL Asesor=EDa y desarrollo de sistemas Guayaquil - Ecuador Cel. (593) 87171157