X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 479E3D1E28E for ; Tue, 4 May 2004 11:38:04 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 86628-06 for ; Tue, 4 May 2004 11:37:47 -0300 (ADT) Received: from fep03-mail.bloor.is.net.cable.rogers.com (fep03-mail.bloor.is.net.cable.rogers.com [66.185.86.73]) by svr1.postgresql.org (Postfix) with ESMTP id 5640CD1B8DC for ; Tue, 4 May 2004 11:37:42 -0300 (ADT) Received: from phlogiston.dydns.org ([65.49.125.184]) by fep03-mail.bloor.is.net.cable.rogers.com (InterMail vM.5.01.05.12 201-253-122-126-112-20020820) with ESMTP id <20040504143739.BCNP64967.fep03-mail.bloor.is.net.cable.rogers.com@phlogiston.dydns.org> for ; Tue, 4 May 2004 10:37:39 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 4FD3A3C8D; Tue, 4 May 2004 10:37:45 -0400 (EDT) Date: Tue, 4 May 2004 10:37:45 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: typecasting numeric(18,4) to varchar/text Message-ID: <20040504143745.GA10467@phlogiston.dyndns.org> Mail-Followup-To: pgsql-sql@postgresql.org References: <63340-22004524133531385@M2W046.mail2web.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <63340-22004524133531385@M2W046.mail2web.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-Authentication-Info: Submitted using SMTP AUTH LOGIN at fep03-mail.bloor.is.net.cable.rogers.com from [65.49.125.184] using ID at Tue, 4 May 2004 10:37:39 -0400 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200405/35 X-Sequence-Number: 17749 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