pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rudi Starcevic <rudi@oasis.net.au>
To: pgsql-sql@postgresql.org
Subject: Float / Numeric ?
Date: Mon, 22 Jul 2002 10:06:00 +1000
Message-ID: <3D3B4C68.1040500@oasis.net.au> (raw)

Hi Folks,

I have an ecommerce application I'm writing and I'm not sure / undecided 
on a
particular way to store shipping rates in PostgreSQL

In this application a user may set the shipping rate per item.

So I have 3 fields - local,state and international.
A forth field, shipping_type (varchar),  holds a value 'dollars' or 
'percent'.

My twisted logic says a user may say this item has 10 perent shipping to 
add or 10 dollars to add.
This means the shipping rate my be either dollars or percent and can be 
set on a per item basis.

For the 3 fields I'm not sure which is best to use - Float or Numeric ?

My application language is ColdFusion and PHP.

I'd like to ask which data type would be the better choice.
At this stage I'm using Float to represent a value that may be either 
dollars or percent.

Perhaps this technique, using a varchar as a type of switch 
(shipping_type) , is incorrect / silly / stupid / not robust enough or 
just plain wrong.

Do you think this is OK and if so which would you use - Floast or Numeric ?
Thanks for your time.
Cheers
Rudi.












view thread (2+ messages)  latest in thread

Message-ID: <3D3B4C68.1040500@oasis.net.au>
Permalink:  ../3D3B4C68.1040500@oasis.net.au/
Also on:    postgresql.org/message-id/3D3B4C68.1040500@oasis.net.au

 · 

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-sql@postgresql.org
  Cc: rudi@oasis.net.au
  Subject: Re: Float / Numeric ?
  In-Reply-To: <3D3B4C68.1040500@oasis.net.au>

* 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