pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: typecasting numeric(18,4) to  varchar/text
Date: Tue, 4 May 2004 10:37:45 -0400
Message-ID: <20040504143745.GA10467@phlogiston.dyndns.org> (raw)
In-Reply-To: <63340-22004524133531385@M2W046.mail2web.com>
References: <63340-22004524133531385@M2W046.mail2web.com>

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



view thread (3+ messages)  latest in thread

Message-ID: <20040504143745.GA10467@phlogiston.dyndns.org>
Permalink:  ../20040504143745.GA10467@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20040504143745.GA10467@phlogiston.dyndns.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ajs@crankycanuck.ca
  Subject: Re: typecasting numeric(18,4) to  varchar/text
  In-Reply-To: <20040504143745.GA10467@phlogiston.dyndns.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox