Clue to define a field data type

From: JORGE MALDONADO <jorgemal1960(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Clue to define a field data type
Date: 2014-08-10 18:40:11
Message-ID: CAAY=A7_qs+Q4z+6wHPNYqCeYiAd0rw0HLf2dO7V41Rk8v7qeWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have a table which will contain a set of pre-defined records defined by
the government of my country. The fields are ID and DESCRIPTION. The ID
field is composed of 3 characters that are always numbers. This means that
I can set such a field as a char(3), varchar(3), smallint or integer, for
example, and all of them will provide the correct functionallity. My
question is, why should I define such a field as a character based type or
a numeric based type? What is the best choice if this field will always be
a 3-digit number?

Best regards,
Jorge Maldonado

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Daniel Staal 2014-08-10 18:54:01 Re: Clue to define a field data type
Previous Message Kevin Grittner 2014-08-08 14:20:37 Re: Upgrading from PG 8.2.5 to 9.1.13