pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jose' Soares Da Silva <sferac@bo.nettuno.it>
To: Marcio Macedo <marciom@conectiva.com.br>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] handle the MONEY type
Date: Tue, 16 Jun 1998 15:24:47 +0000 (UTC)
Message-ID: <Pine.LNX.3.96.980616150940.8937A-100000@proxy> (raw)
In-Reply-To: <358635C9.FB45DF59@conectiva.com.br>

On Tue, 16 Jun 1998, Marcio Macedo wrote:

> Hi
> 
> How can I handle the type money ? (if is exists), how can I make
> insertions and settings  ???
> 
prova=> create table prova (dinheiro money);
CREATE
prova=> insert into prova values (12.50);
INSERT 202089 1
prova=> insert into prova values (10);
INSERT 202090 1
prova=> select * from prova;
dinheiro
--------
$12.50
$10.00
(2 rows)

prova=> select dinheiro+10.25 from prova;
?column?
--------
$22.75
$20.25
(2 rows)

prova=> select dinero / '1.1'::float from prova;
?column?
--------
$11.36
$9.09
(2 rows)

prova=> select dinero - 1.1 from prova;
?column?
--------
$11.40
$8.90
(2 rows)

prova=> select dinero * '1.1'::float from prova;
?column?
--------
$13.75
$11.00
(2 rows)
----
^  ^
OlhO: Be aware that currently isn't possible to CAST a money type to
another types.
                                                   Jose'

                               |  |
~~~~~~~~~~~~~~~~~~~~~~~~       |  |         ~~~~~~~~~~~~~~~~~~~~~~~~
          Progetto HYGEA   ----    ----     www.sferacarta.com
    Sfera Carta Software   ----    ----     sferac@bo.nettuno.it
       Via Bazzanese, 69       |  |         Fax. ++39 51 6131537
Casalecchio R.(BO) Italy       |  |         Tel. ++39 51  591054




view thread (2+ messages)

Message-ID: <Pine.LNX.3.96.980616150940.8937A-100000@proxy>
Permalink:  ../Pine.LNX.3.96.980616150940.8937A-100000@proxy/
Also on:    postgresql.org/message-id/Pine.LNX.3.96.980616150940.8937A-100000@proxy

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: sferac@bo.nettuno.it, marciom@conectiva.com.br
  Subject: Re: [SQL] handle the MONEY type
  In-Reply-To: <Pine.LNX.3.96.980616150940.8937A-100000@proxy>
  References: <358635C9.FB45DF59@conectiva.com.br> <Pine.LNX.3.96.980616150940.8937A-100000@proxy>

* 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