Re: Casting numeric to text

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Hans-Jürgen Schönig <hs(at)cybertec(dot)at>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Casting numeric to text
Date: 2001-04-08 10:05:42
Message-ID: Pine.LNX.4.30.0104081205320.1236-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hans-Jürgen Schönig writes:

> Is there any possibility to cast numeric to text in Postgres 7.0.3?
>
> shop=# select cast(price as text) from products;
> ERROR: Cannot cast type 'numeric' to 'text'

Use the to_char() function.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Hans-Jürgen Schönig 2001-04-08 13:59:25 open and closed paths ...
Previous Message Joel Burton 2001-04-08 09:50:26 Re: Can anyone explain how this works?