Re: What's the difference between int2 and int16?

From: Randolf Richardson <rr(at)8x(dot)ca>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: What's the difference between int2 and int16?
Date: 2003-12-12 19:59:00
Message-ID: Xns944F77CD21F46rr8xca@200.46.204.72
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

""William ZHANG" <na(at)na(dot)na>" wrote in comp.databases.postgresql.hackers:

> I found the uses of int2, int16 and other similiar types misleading
> in PostgreSQL's source code. Sometime it is difficult to figure out
> which should be prefered.
>
> Maybe int2, int4, and int8 refer to database types, while int16, int32
> and int64 refer to C data types. If this is the convention, maintenance
> may be easier.

There's no difference:

smallint = int2 = int16
integer = int4 = int32
largeint = int8 = int64

The single-digit types represent the number of "bytes" used to store
the data, while the double-digit types represne the number if "bits."

--
Randolf Richardson - rr(at)8x(dot)ca
Vancouver, British Columbia, Canada

Please do not eMail me directly when responding
to my postings in the newsgroups.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-12-12 20:18:24 Re: Resurrecting pg_upgrade
Previous Message Andrew Dunstan 2003-12-12 19:51:06 Re: Resurrecting pg_upgrade