Re: single bit integer (TINYINT) revisited for 8.5

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Caleb Cushing <xenoterracide(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: single bit integer (TINYINT) revisited for 8.5
Date: 2009-07-02 16:40:49
Message-ID: 1246552849.27964.502.camel@dn-x300-willij
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Wed, 2009-07-01 at 11:19 -0400, Caleb Cushing wrote:
> I'd like to see this topic revisited since as far as I can see it
> hasn't been seriously discussed in years. I believe the main arguments
> against are why do we need more more numeric datatypes and increased
> maintenance. It would seem to me that a tinyint datatype maintenance
> wise would get all the same updates as the other int types, making it
> only a slight increase in maintenance. I think there was 1 more reason
> but I can't find the original thread now.
>
> most (if not all?) of posgresql's major competitor's (mysql, sql
> server, db2, etc) support a single bit integer datatype. it would
> bring increased compatibility with existing mysql apps esp, making
> them easier to port.
>
> It (in theory?) should also bring a speed enhancement where usable
> since it would take less disk space.
>
> A couple of times I've been told "you don't need tinyint, use boolean"
> which is not true, several projects I've worked on I've needed and
> integer field that supports number within a small range 0-5 1-10 1-100
> or something similar. I end up using smallint but it's range is huge
> for the actual requirements.

Completely agree.

I'm most or the way through working on this as an add-on module, rather
than a new datatype in core. I don't see much reason to include it in
core: its not an SQL standard datatype, it complicates catalog entries
and most people don't need or want it.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-07-02 16:46:04 Re: Upgrading our minimum required flex version for 8.5
Previous Message Kevin Grittner 2009-07-02 16:28:42 Re: Upgrading our minimum required flex version for 8.5