Received: from smtp.stellison.co.uk ([212.56.66.225]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eBCAKmm53268 for ; Tue, 12 Dec 2000 05:20:48 -0500 (EST) (envelope-from francis@stellison.co.uk) Received: (qmail 7706 invoked from network); 12 Dec 2000 10:21:21 -0000 Received: from unknown (HELO neo) (unknown) by unknown with SMTP; 12 Dec 2000 10:21:21 -0000 From: "Francis Solomon" To: =?iso-8859-1?B?Qm9yZWsgTHVwb23sc2v9?= , Subject: RE: SQL parse error Date: Tue, 12 Dec 2000 10:21:52 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Importance: Normal X-Archive-Number: 200012/77 X-Sequence-Number: 408 Hi Borek, What version of PostgreSQL are you using? This works fine for me on 7.02. Time to update, maybe? Hope this helps Francis > > Hello all, > > My following problem is: > > swports=# select substring(cp from 1 for 4)::int4 from out2cp; > ERROR: pg_atoi: error in "6.1,": can't parse ".1," > > SQL syntax is apparently OK. When I omit the typecast, the query > works: > > swports=# select substring(cp from 1 for 4) from out2cp; > substr > -------- > 3182 > 3182 > 3182 > -8<- text deleted --- > > The cp entries are varchars in form NNNN.N, where N is numeral. > So can someone explain why the parse error? >