please help me with text cast to int .... - Mailing list pgsql-sql

From Theodore Petrosky
Subject please help me with text cast to int ....
Date
Msg-id 20040711162246.34618.qmail@web41004.mail.yahoo.com
Whole thread Raw
Responses Re: please help me with text cast to int ....  (Phil Endecott <spam_from_postgresql_sql@chezphil.org>)
Re: please help me with text cast to int ....  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List pgsql-sql
I give up.. what don't I understand about casting and
ints and text..  

i have a table jobinfo with:

acode text,
jobnumber text default
nextval('public.jobinfo_seq'::text),
jobtitle text

I have about 3000 rows starting with jobnumber = 1000.

SELECT jobnumber, jobtitle FROM jobinfo WHERE
jobnumber >= 999 ORDER BY jobnumber ASC;

The above SQL produces no rows. however...

SELECT jobnumber, jobtitle FROM jobinfo WHERE
jobnumber >= 200 ORDER BY jobnumber ASC;

produces rows with jobnumber >= 2000

if I change the query with jobnumber >= 201, I get
rows >= 2010.

it is as if there was a silent zero being appended to
the end of my int in the query. What am I missing,
please.

select version();                                                      version
            
 

-------------------------------------------------------------------------------------------------------------------------PostgreSQL
7.4.2on powerpc-apple-darwin7.3.0,
 
compiled by GCC gcc (GCC) 3.3 20030304 (Apple
Computer, Inc. build 1495)
(1 row)

Ted

    
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 


pgsql-sql by date:

Previous
From: Rajesh Kumar Mallah
Date:
Subject: Re: Problem in Stored Procedures
Next
From: Phil Endecott
Date:
Subject: Re: please help me with text cast to int ....