Fixed-point scalars?

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: ML PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Fixed-point scalars?
Date: 2006-10-18 00:46:44
Message-ID: 45357974.7050703@cox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

PG 8.1.5

The closed-source RDBMS that we are hoping to archive on PostgreSQL
8.1.5 has fixed-point scalars, where the data is *stored* as a plain
old scalar, but is run-time *interpreted* as having a decimal point.
For example:

SMALLINT(2)
INTEGER(2)
BIGINT(2)

We use INTEGER(2) *extensively* for monetary values that won't
exceed $21,474,836.47, and BIGINT(2) for those times where it might.

This is very useful since integer arithmetic is so fast, and you
know the field will always be 4 bytes.

Are these data-types not in PG, or am I missing something?

Also, how do you calculate the size of a NUMERIC?

Lastly, I know they are the same, but which is the
"preferred/standard" type: NUMERIC or DECIMAL?

Thanks
- --
Ron Johnson, Jr.
Jefferson LA USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFNXl0S9HxQb37XmcRAsoiAJ0f8UGrYRm8eE3eX6EJYDJn6riV1wCfScHC
J7l8E1S7WS++1wDxW/9k6b0=
=zhgS
-----END PGP SIGNATURE-----

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Peterson 2006-10-18 01:07:08 Re: uuid c function contrib
Previous Message Ragnar 2006-10-17 23:56:36 Re: Strange behavior on non-existent field in subselect?