X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2BBFD52879 for ; Sun, 22 May 2005 08:32:23 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 59332-04 for ; Sun, 22 May 2005 11:32:15 +0000 (GMT) Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id B162F52877 for ; Sun, 22 May 2005 08:32:12 -0300 (ADT) Received: (qmail invoked by alias); 22 May 2005 11:32:54 -0000 Received: from p54BE4243.dip.t-dialin.net (EHLO [192.168.0.2]) [84.190.66.67] by mail.gmx.net (mp023) with SMTP; 22 May 2005 13:32:54 +0200 X-Authenticated: #23913783 Message-ID: <42906D06.3090200@gmx.net> Date: Sun, 22 May 2005 13:29:10 +0200 From: Timo Roessner User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: datatype conversion on postgresql 7.4.1 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.204 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200505/180 X-Sequence-Number: 21493 hi everybody, i got the following problem: i have a database running on a postgresqlserver version 7.4.1, in the database is a table with 4 columns containing float-numbers. what i want to do now is, to convert the type of those columns from float to numeric, because i want to limit the positions after the decimal point to 2. what works fine in v. 8: either alter table fragment alter column x type numeric(15,2) or update fragment set x = round(x,2) but both wont work with version 7.4.1! when i look into the documentation it seems to say that in 7.4.1 round() can only round to a given number of positions after the decimal point when used with a numeric type, but not with floats! and if i try something like: alter table fragment alter column x type numeric(15,2) i get an syntax error, so this seems to be no feature in 7.4.1 (didnt find anything like that in the docs too....) what can i do to solve this? there must be some way in postgresql 7.4.1, if there is no way to do that, i have to build up the whole database from scratch........there must be a way to convert float to numeric values in 7.4.1 , but i dont have a single clue... thx for any help in advance