Re: [SQL] Howto convert floats to text?

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: Martin Leja <martin(at)unix-ag(dot)org>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Howto convert floats to text?
Date: 1999-06-06 12:26:21
Message-ID: l03130305b38017f776fa@[147.233.159.109]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

At 20:22 +0300 on 04/06/1999, Martin Leja wrote:

>
> Thanks for the tip, but if i try the above, i get:
> ERROR: Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'.
> Recognized languages are sql, C, internal and the created procedural
> languages.
>
> what is pl/pgsql? I using postgres 6.3.2 (slink/stable debian package), do
> i hve to upgrade to a higer version, or is this plpgsql thing to be
> installed separately?

pl/pgsql is new in 6.4. If you are working with 6.3.2, you may define a
function in SQL as follows:

testing=> CREATE FUNCTION text( float8 ) returns text
testing-> AS 'select textin( float8out( $1 ) )'
testing-> LANGUAGE 'sql';

Test this:

testing=> select text( 18.4 ) || ' is the number';
?column?
------------------
18.4 is the number
(1 row)

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Herouth Maoz 1999-06-06 12:31:45 Re: [SQL] Getting primary key from insert statement
Previous Message Herouth Maoz 1999-06-06 12:06:14 Re: [SQL] OUTER JOINs in PostgreSQL