Re: Casting numeric to text

From: Cedar Cox <cedarc(at)visionforisrael(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Hans-Jürgen Schönig <hs(at)cybertec(dot)at>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Casting numeric to text
Date: 2001-04-08 23:20:09
Message-ID: Pine.LNX.4.21.0104090218440.7109-100000@nanu.visionforisrael.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sun, 8 Apr 2001, Peter Eisentraut wrote:

> 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.

When would one want to use cast()? What is the difference between cast
and :: ? After a quick look in the documentation I couldn't find
anything..

-Cedar

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Cedar Cox 2001-04-08 23:57:05 Re: Need help with EXECUTE function
Previous Message Cedar Cox 2001-04-08 23:03:21 Re: Double-nesting quotes?