pg.ddx.io  pgsql-patches@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ryan Bradetich <rbradetich@gmail.com>
To: Jaime Casanova <jcasanov@systemguards.com.ec>
Cc: pgsql-patches <pgsql-patches@postgresql.org>
Subject: Re: [PgFoundry] Unsigned Data Types [1 of 2]
Date: Mon, 8 Sep 2008 20:08:12 -0700
Message-ID: <e739902b0809082008p6c694a20ufd526d1ce5d46750@mail.gmail.com> (raw)
In-Reply-To: <3073cc9b0809062330o62fd74dax74b1730cedc0fbb9@mail.gmail.com>
References: <e739902b0808311335l1ad5d425r2704429c386f2f88@mail.gmail.com>
	<3073cc9b0809061341q5c747488i85491e4c8e2420ba@mail.gmail.com>
	<3073cc9b0809062330o62fd74dax74b1730cedc0fbb9@mail.gmail.com>

Hello Jaime,

> why i need the cast in this case? even if the cast is really necesary
> (the message seems realy ugly)
>
> contrib_regression=# select * from t1 where f1 > 35;
> ERROR:  unsupported type: 16486
>
> contrib_regression=# select * from t1 where f1 > 35::uint4;
>  f1
> -----
>  36
>  37
>  38

Can you send me the test case that generates this error?
My regression tests do not include a table t1 so I was not able
to reproduce this error directly.

I was unable to reproduce this error by guessing.
I tried the following tests:

contrib_regression=# create table t1 (f1 int4 not null);
CREATE TABLE
contrib_regression=# insert into t1 values (1), (5), (10), (20);
INSERT 0 4
contrib_regression=# select * from t1 where f1 > 7;
 f1
----
 10
 20
(2 rows)

contrib_regression=# drop table t1;
DROP TABLE
contrib_regression=# create table t1 (f1 uint4 not null);
CREATE TABLE
contrib_regression=# insert into t1 values (1), (5), (10), (20);
INSERT 0 4
contrib_regression=# select * from t1 where f1 > 7;
 f1
----
 10
 20
(2 rows)

contrib_regression=# drop table t1;
DROP TABLE
contrib_regression=# create table t1 (f1 numeric not null);
CREATE TABLE
contrib_regression=# insert into t1 values (1), (5), (10), (20);
INSERT 0 4
contrib_regression=# select * from t1 where f1 > 7;
 f1
----
 10
 20
(2 rows)

contrib_regression=# drop table t1;
DROP TABLE
contrib_regression=# create table t1 (f1 int4 primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"t1_pkey" for table "t1"
CREATE TABLE
contrib_regression=# insert into t1 select * from generate_series(1, 100000);
INSERT 0 100000
contrib_regression=# analyze t1;
ANALYZE
contrib_regression=# explain select f1 from t1 where f1 > 99998;
                            QUERY PLAN
-------------------------------------------------------------------
 Index Scan using t1_pkey on t1  (cost=0.00..8.43 rows=10 width=4)
   Index Cond: (f1 > 99998)
(2 rows)

contrib_regression=# select f1 from t1 where f1 > 99998;
   f1
--------
  99999
 100000
(2 rows)


My testing shows this is working correctly.  I am very interested in
your test case
to help me figure out what I am missing!

Thanks!

- Ryan



view thread (26+ messages)  latest in thread

Message-ID: <e739902b0809082008p6c694a20ufd526d1ce5d46750@mail.gmail.com>
Permalink:  ../e739902b0809082008p6c694a20ufd526d1ce5d46750@mail.gmail.com/
Also on:    postgresql.org/message-id/e739902b0809082008p6c694a20ufd526d1ce5d46750@mail.gmail.com

 · 

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: rbradetich@gmail.com, jcasanov@systemguards.com.ec
  Subject: Re: [PgFoundry] Unsigned Data Types [1 of 2]
  In-Reply-To: <e739902b0809082008p6c694a20ufd526d1ce5d46750@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