Re: what data type to store fixed size integer?

From: "David Johnston" <polobo(at)yahoo(dot)com>
To: "'Arash pajoohande'" <apajoohande(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: what data type to store fixed size integer?
Date: 2011-04-11 16:48:18
Message-ID: 00c001cbf868$4328b6a0$c97a23e0$@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>>>> the data type does not need any arithmetic operations (as of integers).

You arguably do not have a number but simply a string that looks like a
number. Other examples are zip-codes and phone-numbers if you ignore
symbols. Thus you should probably use an appropriately sized char/varchar.

Just something to consider; there is no hard and fast rule about this kind
of thing. If you can think of any logical use of arithmetic operators, even
if you do not need them now, you should use an integer.

Dave

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Willy-Bas Loos 2011-04-11 18:26:40 CREATE RULE _copy AS ON COPY TO ...
Previous Message Dmitriy Igrishin 2011-04-11 16:17:30 Re: Global Variables in plpgsql