pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
DECIMAL or NUMERIC Data Types
2+ messages / 2 participants
[nested] [flat]

* DECIMAL or NUMERIC Data Types
@ 2012-01-05 18:38  Carlos Mennens <carlos.mennens@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Carlos Mennens @ 2012-01-05 18:38 UTC (permalink / raw)
  To: 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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: DECIMAL or NUMERIC Data Types
@ 2012-01-05 19:14  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Carlos Mennens <carlos.mennens@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2012-01-05 19:14 UTC (permalink / raw)
  To: Carlos Mennens <carlos.mennens@gmail.com>; +Cc: pgsql-sql

Carlos Mennens <carlos.mennens@gmail.com> writes:
> 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?

No, because they're the same type in Postgres, as you were already told
last week:
http://archives.postgresql.org/pgsql-general/2011-12/msg00899.php

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2012-01-05 19:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-01-05 18:38 DECIMAL or NUMERIC Data Types Carlos Mennens <carlos.mennens@gmail.com>
2012-01-05 19:14 ` Tom Lane <tgl@sss.pgh.pa.us>

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