Re: Function to convert numeric string to number in version 8.0 - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: Function to convert numeric string to number in version 8.0
Date
Msg-id 20060309223504.GB21716@wolff.to
Whole thread Raw
In response to Function to convert numeric string to number in version 8.0  (David Gaudine <davidg@alcor.concordia.ca>)
List pgsql-novice
On Thu, Mar 09, 2006 at 16:13:47 -0500,
  David Gaudine <davidg@alcor.concordia.ca> wrote:
> Is there a function that will convert a numeric string to a number,
> returning zero if the string is empty?

You can use to_number to convert a string to a number. You can combine
that with a case statement to only convert strings that look like a number
and return zero for strings that don't look like a number.

pgsql-novice by date:

Previous
From: David Gaudine
Date:
Subject: Function to convert numeric string to number in version 8.0
Next
From: 王宝兵
Date:
Subject: Re: Where Can I Find The Code Segment For WAL Control?