Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vlmw6-0008HA-56 for pgsql-sql@arkaria.postgresql.org; Wed, 27 Nov 2013 21:46:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Vlmw5-0008CG-KF for pgsql-sql@arkaria.postgresql.org; Wed, 27 Nov 2013 21:46:17 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vlmw4-0008Ah-NP for pgsql-sql@postgresql.org; Wed, 27 Nov 2013 21:46:16 +0000 Received: from oldperseverance.encs.concordia.ca ([132.205.96.92]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vlmw1-0003VL-Ib for pgsql-sql@postgresql.org; Wed, 27 Nov 2013 21:46:15 +0000 Received: from cacao.encs.concordia.ca (emilu@cacao.encs.concordia.ca [132.205.47.225]) by oldperseverance.encs.concordia.ca (envelope-from emilu@encs.concordia.ca) (8.13.7/8.13.7) with ESMTP id rARLkCAh003816 for ; Wed, 27 Nov 2013 16:46:12 -0500 Message-ID: <52966824.8070404@encs.concordia.ca> Date: Wed, 27 Nov 2013 16:46:12 -0500 From: Emi Lu Reply-To: emilu@encs.concordia.ca User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:17.0) Gecko/20131028 Thunderbird/17.0.10 MIME-Version: 1.0 To: pgsql-sql Subject: isnumeric(varchar) by psql Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on oldperseverance.encs.concordia.ca at 2013/11/27 16:46:12 EST X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Hello, Does psql provide a function isnumeric(varchar) to check if a varchar can be converted to a numeric field? E.g., x | isnumeric ----------+----------- | f . | f .0 | t 0. | t 0 | t 1 | t 123 | t 123.456 | t abc | f 1..2 | f 1.2.3.4 | f 1x234 | f 1.234e-5 | t Thanks a lot Emi -- Found examples users created by self. If psql provides similar one already? -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql