pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Davis <mdavis@sevainc.com>
To: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
To: 'pgsql-admin@postgresql.org' <pgsql-admin@postgresql.org>
To: 'pgsql-interfaces@postgresql.org' <pgsql-interfaces@postgresql.org>
To: 'pgsql-general@postgresql.org' <pgsql-general@postgresql.org>
Subject: Numeric and money
Date: Wed, 3 Jan 2001 11:11:36 -0700
Message-ID: <01C07575.F26395D0.mdavis@sevainc.com> (raw)

Hello Everyone,

I am in the process of migrating my Access97 application to PostgreSQL.  So 
far everything looks great with one exception.  I converted my currency 
fields in Access to numeric(9,2) as recommended in the PostgreSQL 
documentation.  Many things to don't play well with the numeric the data 
type.  Here are some examples:

       create table tst (id int, amount numeric(9,2));
       insert into tst values (1, 1.10);
       insert into tst values (2, 1.00);
       insert into tst values (2, 2.00);
       select * from tst where amount = 1; -- works
       select * from tst where amount = 1.1; -- fails
       select * from tst where amount = 1.10; -- fails
       select amount::varchar from tst;  -- fails
       select amount::money from tst; -- fails
       select id || ', ' || id from tst;  -- works
       select id || ', ' || amount from tst; -- fails



view thread (5+ messages)  latest in thread

Message-ID: <01C07575.F26395D0.mdavis@sevainc.com>
Permalink:  ../01C07575.F26395D0.mdavis@sevainc.com/
Also on:    postgresql.org/message-id/01C07575.F26395D0.mdavis@sevainc.com

 · 

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-interfaces@postgresql.org
  Cc: mdavis@sevainc.com, pgsql-sql@postgresql.org, pgsql-admin@postgresql.org, pgsql-general@postgresql.org
  Subject: Re: Numeric and money
  In-Reply-To: <01C07575.F26395D0.mdavis@sevainc.com>

* 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