Re: typecasting numeric(18,4) to varchar/text - Mailing list pgsql-sql

From Andrew Sullivan
Subject Re: typecasting numeric(18,4) to varchar/text
Date
Msg-id 20040504143745.GA10467@phlogiston.dyndns.org
Whole thread Raw
In response to typecasting numeric(18,4) to varchar/text  ("ashok@kalculate.com" <ashok@kalculate.com>)
Responses Re: typecasting numeric(18,4) to varchar/text
List pgsql-sql
On Tue, May 04, 2004 at 09:35:31AM -0400, ashok@kalculate.com wrote:
> create table a (a numeric(18,4));
> create table b (b varchar(25));
> insert into a values(12000.43);
> insert into b select (a.a)::varchar;

Which version is that?  Here's my session:

andrewtest=# create table a (a numeric(18,4));
CREATE TABLE
andrewtest=# create table b (b varchar(25));
CREATE TABLE
andrewtest=# insert into a values(12000.43);
INSERT 17168 1
andrewtest=# insert into b select (a.a)::varchar;
INSERT 17169 1

That's on 7.4.2.  You might want to try casting to text first.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca


pgsql-sql by date:

Previous
From: "Andrei Bintintan"
Date:
Subject: Re: Database structure
Next
From: "scott.marlowe"
Date:
Subject: Re: invalid input syntax for integer: ""