Re: Unsigned integer types

From: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
To: Maciej Gajewski <maciej(dot)gajewski0(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, Jim Nasby <jim(at)nasby(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgresql(dot)org Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unsigned integer types
Date: 2013-05-29 17:23:55
Message-ID: 51A639AB.9010205@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 05/29/2013 11:33 AM, Maciej Gajewski wrote:
> I will implement it as an extension then.
>
> My feeling is that PostgreSQL extensions tend to fall into obscurity.
> As an ordinary user it took me really long time to find out that
> interesting features are available in form of extensions; they are
> certainly under-marketed. But this is a topic for separate discussion.
>
>> You have not at all addressed the real problem with doing what you are asking for, the one that Tom Lane stated:
>
>>> Basically, there is zero chance this will happen unless you can find
>>> a way of fitting them into the numeric promotion hierarchy that doesn't
>>> break a lot of existing applications. We have looked at this more than
>>> once, if memory serves, and failed to come up with a workable design
>>> that didn't seem to violate the POLA.
>>>
> I'm sorry, I thought my proposal was clear.
>
> I propose to not integrate the unsigned types into existing promotion
> hierarchy, and behave just like gcc would with -Werror: require
> explicit cast. Between them, the unsigned types would be automatically
> converted up (uint2 > uint4 > uint8).
+1

(And we could even put some possible sample cast sets in contrib for those
who need automatic casts and are willing to do the required debugging )

--
Hannu Krosing
PostgreSQL Consultant
Performance, Scalability and High Availability
2ndQuadrant Nordic OÜ

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2013-05-29 17:40:48 Re: XLogInsert scaling, revisited
Previous Message Jeff Davis 2013-05-29 17:18:35 Re: getting rid of freezing