On Tue, 12 Dec 2000, Tom Lane wrote:

TL> play=> create table out2cp(cp varchar(6));
TL> CREATE
TL> play=> insert into out2cp values('3182.1');
TL> INSERT 405833 1
TL> play=> insert into out2cp values('3182.2');
TL> INSERT 405834 1
TL> play=> select substring(cp from 1 for 4)::int4 from out2cp;
TL>  ?column?
TL> ----------
TL>      3182
TL>      3182
TL> (2 rows)

   When I do this, it works for me, too. But when I do it on my current
database, something breaks. The table I work on is:

swports=# \d out2cp
           Table "out2cp"
 Attribute |    Type     | Modifier 
-----------+-------------+----------
 cp        | varchar(10) | 
 outlet    | varchar(10) | 
 location  | varchar(32) | 
Index: o2c_cp

   Values in cp field look like this:

swports=# select cp from out2cp ;
   cp    
---------
 3182.4
 3182.7
 3182.2
 3182.5
 3182.6
 3182.8
 3169.1
 3169.3
 3169.4
 3169.7
 3165.1

   Bye Borek

-- 

=====================================================================
BOREK LUPOMESKY                Usti nad Labem, Czech Republic, Europe
WWW: http://www.volny.cz/borekl/                  PGP keyid: B6A06AEB
==========[ MIME/ISO-8859-2 & PGP encrypted mail welcome ]===========


Reply via email to