DECIMAL or NUMERIC Data Types

From: Carlos Mennens <carlos(dot)mennens(at)gmail(dot)com>
To: "PostgreSQL (SQL)" <pgsql-sql(at)postgresql(dot)org>
Subject: DECIMAL or NUMERIC Data Types
Date: 2012-01-05 18:38:01
Message-ID: CAAQLLO5_HFLG4r1qBs0PxVXLrOJMffZK4Ujy2g51ru2ii6=kTg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Does it matter when writing SQL code in PostgreSQL if I use DECIMAL or
NUMERIC date types for a column named 'price' assuming it's to store
the associated items actual dollar amount?

Reading the fine manual*, I can't find a single difference between
either and they both are supported / recognized by PostgreSQL:

-decimal variable user-specified precision, exact up to 131072
digits before the decimal point; up to 16383 digits after the decimal
point
-numeric variable user-specified precision, exact up to 131072
digits before the decimal point; up to 16383 digits after the decimal
point

CREATE TABLE computers
(
id serial primary key,
make varchar(50) not null,
model varchar(50) not null,
owner varchar(50) not null
price decimal(7,2) not null,
warranty date not null
);

*Source = http://www.postgresql.org/docs/9.1/static/datatype-numeric.html

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2012-01-05 19:14:37 Re: DECIMAL or NUMERIC Data Types
Previous Message Alvaro Herrera 2012-01-05 17:52:26 Re: Fwd: i want small information regarding postgres