Received: from shaked.cc.openu.ac.il (shaked.cc.openu.ac.il [147.233.145.65]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA34777 for ; Wed, 13 Oct 1999 10:26:24 -0400 (EDT) (envelope-from herouth@oumail.openu.ac.il) Received: from [147.233.159.109] (herouth@mac-herouth.pc.openu.ac.il [147.233.159.109]) by shaked.cc.openu.ac.il (8.8.8/8.8.8) with ESMTP id QAA07906; Wed, 13 Oct 1999 16:22:52 +0200 (IST) X-Sender: herouth@shaked.cc.openu.ac.il Message-Id: In-Reply-To: <07ff01bf1501$62342b80$02010101@duncan> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Wed, 13 Oct 1999 16:23:02 +0200 To: "Duncan Kinder" , "Postgres SQL List" From: Herouth Maoz Subject: Re: [SQL] Money variable At 00:29 +0200 on 13/10/1999, Duncan Kinder wrote: > I cannot enter data into these fields in Postgres. When entering "$20.00" > for price I get the following: "error near '.00'. When entering "$20" I > get "out of range." and when entering "20.00" I get " attribute 'price' is > of type'money' but expression is of type 'float8'. You will have to rewrite > or cast the expression. > > I have drooped and re-created the table. I have attempted to enter this > data numerous times. No luck. > > How do I enter money data in Postgres? Money is not recommended (deprecated). The recommended method is to use NUMERIC with a two-digit precision (or three, in countries where relevant, which is exactly why this recommendation was made). But if you insist on using money for the sake of the example, you should put the values in single quotes, like strings: INSERT INTO money_table (money_field) VALUES ('20.00'); Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma