X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1E9EB52BCE for ; Wed, 17 Aug 2005 13:46:15 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49825-08 for ; Wed, 17 Aug 2005 16:46:12 +0000 (GMT) Received: from tomts13-srv.bellnexxia.net (tomts13.bellnexxia.net [209.226.175.34]) by svr1.postgresql.org (Postfix) with ESMTP id 8D86C529B3 for ; Wed, 17 Aug 2005 13:46:08 -0300 (ADT) Received: from acer.sympatico.ca ([70.50.50.41]) by tomts13-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050817164608.SZUD25800.tomts13-srv.bellnexxia.net@acer.sympatico.ca> for ; Wed, 17 Aug 2005 12:46:08 -0400 Message-Id: <5.2.1.1.0.20050817124436.02d4c970@pop6.sympatico.ca> X-Sender: b1wudu74@pop6.sympatico.ca X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Wed, 17 Aug 2005 12:46:01 -0400 To: pgsql-sql@postgresql.org From: Frank Bax Subject: Re: [despammed] converting varchar to integer In-Reply-To: <20050817093029.GA1647@kaufbach.delug.de> References: <1124235288.43027818cb6e3@email.gigaweb.cz> <1124235288.43027818cb6e3@email.gigaweb.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.038 required=5 tests=[AWL=-0.013, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200508/122 X-Sequence-Number: 22350 At 05:30 AM 8/17/05, Kretschmer Andreas wrote: >tv@fuzzy.cz schrieb: > > > Hi, > > > > I have a varchar column, and I need to > > > > 1) check the value in it is an integer > > 2) get the integer value (as integer) > >test=# update foo set n = substring(t , '[0-9]')::int; I think you meant: update foo set n = substring(t , '[0-9]+')::int;