X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B0647D1D362 for ; Tue, 3 Feb 2004 14:17:52 +0000 (GMT) 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 40794-02 for ; Tue, 3 Feb 2004 10:17:32 -0400 (AST) Received: from web13805.mail.yahoo.com (web13805.mail.yahoo.com [216.136.175.15]) by svr1.postgresql.org (Postfix) with SMTP id A1F2FD1B4B7 for ; Tue, 3 Feb 2004 10:17:29 -0400 (AST) Message-ID: <20040203141733.80158.qmail@web13805.mail.yahoo.com> Received: from [216.173.173.66] by web13805.mail.yahoo.com via HTTP; Tue, 03 Feb 2004 06:17:33 PST Date: Tue, 3 Feb 2004 06:17:33 -0800 (PST) From: Chris Gamache Reply-To: cgg007@yahoo.com Subject: Re: Alternative to "Money" ... To: Harald Fuchs , pgsql-admin@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/24 X-Sequence-Number: 12198 ... I can't _quite_ tell if you're serious or not ... :) If you are serious, are you saying to do something like: CREATE TABLE new_money (product text, dollars int4, cents int4); INSERT INTO new_money (product, dollars, cents) values ('Flowbee','19','95'); INSERT INTO new_money (product, dollars, cents) values ('Garth Brooks\'s Greatest Hits','9','99'); SELECT product, (dollars || '.' || cents)::numeric FROM new_money; product | numeric ------------------------------+--------- Flowbee | 19.95 Garth Brooks's Greatest Hits | 9.99 (2 rows) ... Will that really improve performance? I'd probably have to create a view and rule on the view if I didn't want to drasticly alter the way I'm handling currency in my pre-existing code ... CG --- Harald Fuchs wrote: > In article <20040130203122.GA1488@wolff.to>, > Bruno Wolff III writes: > > > On Fri, Jan 30, 2004 at 10:55:13 -0800, > > Chris Gamache wrote: > >> Well, after living with the (depreciated) Money datatype for 5 years, I > think > >> its finally time to say goodbye (and now that we have DROP COLUMN it'll be > MUCH > >> easier transition). What's the preferred monetary datatype? numeric(10,2)? > >> float4? float8? We're dealing only with US Dollars. > > > You probably just want plain numeric. > > As long as you don't want to deal with the new US budget deficit, > storing cents in an INT or BIGINT column might perform better. > > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/