Received: from bologna.nettuno.it (bologna.nettuno.it [193.43.2.1]) by hub.org (8.9.3/8.9.3) with ESMTP id IAA79195 for ; Fri, 4 Jun 1999 08:55:20 -0400 (EDT) (envelope-from jose@sferacarta.com) Received: from proxy.sferacarta.com (mail@sfcabop1.nettuno.it [193.207.10.213]) by bologna.nettuno.it (8.8.6/8.8.8/NETTuno 3.2) with ESMTP id OAA04377; Fri, 4 Jun 1999 14:55:06 +0200 (MDT) Received: from rosso.sferacarta.com (sferacarta.com) [10.20.30.5] by proxy.sferacarta.com with esmtp (Exim 2.05 #1 (Debian)) id 10pvM0-0005vn-00; Fri, 4 Jun 1999 14:53:52 +0000 Message-ID: <3757CBD7.66FBE889@sferacarta.com> Date: Fri, 04 Jun 1999 14:51:35 +0200 From: =?iso-8859-1?Q?Jos=E9?= Soares X-Mailer: Mozilla 4.5 [it] (Win95; I) X-Accept-Language: it MIME-Version: 1.0 To: Martin Leja CC: pgsql-sql@postgresql.org Subject: Re: [SQL] Howto convert floats to text? References: <199906041045.GAA67778@hub.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Use this PL/pgSQL script to create text(float), varchar(float), char(float): create function "varchar"(float) returns varchar as 'begin return $1; end; ' language 'plpgsql'; create function bpchar(float) returns bpchar as 'begin return $1; end; ' language 'plpgsql'; create function text(float) returns text as 'begin return $1; end; ' language 'plpgsql'; create function float_text(float) returns text as ' select text($1); ' language 'sql'; Martin Leja ha scritto: > Hi, > > there are the following functions to convert types other than text to text: > > $bash psql -c "\df" | sed -n '1,2 p; /^text.*convert/ p' > > return_type|function |arguments |description > > -----------+------------------+--------------------+------------------------ > ---- > text |datetime_text |datetime |convert > > text |int2_text |int2 |convert > > text |int4_text |int4 |convert > > text |oid_text |oid |convert > > text |text |datetime |convert > > text |text |timespan |convert > > text |text |int4 |convert > > text |text |int2 |convert > > text |text |oid |convert > > text |timespan_text |timespan |convert > > > is there realy no function to convert a float to text? > > -- > Regards, martin@unix-ag.org -- ______________________________________________________________ PostgreSQL 6.5.0 on i586-pc-linux-gnu, compiled by gcc 2.7.2.3 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Jose'