From: Randall Lucas <rlucas@tercent.net>
To: pgsql-sql@postgresql.org
Subject: Testing castability of text to numeric
Date: Tue, 13 May 2003 17:01:34 -0400
Message-ID: <14ACA3C2-8586-11D7-8D9A-000A957653D6@tercent.net> (raw)
In-Reply-To: <312680000.1052857873@lerlaptop.iadfw.net>
Hi All,
I am trying to create a function that will test if a given text value
may safely be cast to numeric, returning the numeric cast or null if
impossible.
Is there a way to "catch" the "ERROR: Bad numeric input format" error?
I ask that rather than about what the numeric format is for regex-style
testing because if this works I may want to use a similar method to
check if a given text value casts safely to other types, like date.
Best,
Randall
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: rlucas@tercent.net
Subject: Re: Testing castability of text to numeric
In-Reply-To: <14ACA3C2-8586-11D7-8D9A-000A957653D6@tercent.net>
References: <312680000.1052857873@lerlaptop.iadfw.net> <14ACA3C2-8586-11D7-8D9A-000A957653D6@tercent.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox