Re: what data type to store fixed size integer? - Mailing list pgsql-general

From David Johnston
Subject Re: what data type to store fixed size integer?
Date
Msg-id 00c001cbf868$4328b6a0$c97a23e0$@yahoo.com
Whole thread Raw
In response to what data type to store fixed size integer?  (Arash pajoohande <apajoohande@gmail.com>)
Responses Re: what data type to store fixed size integer?
List 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



 

pgsql-general by date:

Previous
From: Dmitriy Igrishin
Date:
Subject: Re: Global Variables in plpgsql
Next
From: George Woodring
Date:
Subject: Re: autovacuum issue after upgrade to 9.0.1