pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Yasir Malik <ymalik@cs.stevens-tech.edu>
To: Mark Tabash <mark.tabash@novacolor.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: create function atof?
Date: Sat, 5 Jun 2004 22:16:37 -0400 (EDT)
Message-ID: <Pine.NEB.4.58.0406052215060.22758@pink-elephant.cs.stevens-tech.edu> (raw)
In-Reply-To: <200402200901.21616.mark.tabash@novacolor.ca>
References: <200402200901.21616.mark.tabash@novacolor.ca>

> Is it possible to create a database function that mimics the C function atof?
> I'm guessing it should look something like this:

You can do this to convert a string to a float:
select '3.14'::float + 1;

 ?column?
----------
     4.14
(1 row)

Is that what you want?
Yasir



view thread (5+ messages)

Message-ID: <Pine.NEB.4.58.0406052215060.22758@pink-elephant.cs.stevens-tech.edu>
Permalink:  ../Pine.NEB.4.58.0406052215060.22758@pink-elephant.cs.stevens-tech.edu/
Also on:    postgresql.org/message-id/Pine.NEB.4.58.0406052215060.22758@pink-elephant.cs.stevens-tech.edu

 · 

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 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: ymalik@cs.stevens-tech.edu, mark.tabash@novacolor.ca
  Subject: Re: create function atof?
  In-Reply-To: <Pine.NEB.4.58.0406052215060.22758@pink-elephant.cs.stevens-tech.edu>
  References: <200402200901.21616.mark.tabash@novacolor.ca> <Pine.NEB.4.58.0406052215060.22758@pink-elephant.cs.stevens-tech.edu>

* 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