agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Emi Lu <emilu@encs.concordia.ca>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: isnumeric(varchar) by psql
Date: Wed, 27 Nov 2013 16:46:12 -0500
Message-ID: <52966824.8070404@encs.concordia.ca> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

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



view thread (2+ messages)  latest in thread

Message-ID: <52966824.8070404@encs.concordia.ca>
Permalink:  ../52966824.8070404@encs.concordia.ca/
Also on:    postgresql.org/message-id/52966824.8070404@encs.concordia.ca

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: emilu@encs.concordia.ca
  Subject: Re: isnumeric(varchar) by psql
  In-Reply-To: <52966824.8070404@encs.concordia.ca>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox