Re: unsigned types, binary op. and cast pb

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: pdidelon(at)cea(dot)fr
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: unsigned types, binary op. and cast pb
Date: 2004-03-20 18:42:32
Message-ID: 405C9098.30405@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Pierre Didelon wrote:
> I post this mail yesterday to the hacker list as a reply/following,
> but it has been stalled, so I re-post it here...
>
> Hi postgresql experts,
>
> I am new to the group so forgive any misunderstanding or repetition.
>
> I noticed a previous mail concerning unsigned types, claiming
> several solutions, which are not satisfactory (at least for me).
> I need a 4 bytes unsigned integer to store a 32 bit mask,
> accepting binary operators (&, |, ~, ...) to perform selections
> in "standard" SQL, as simple as possible.
> I want to work, as transparently as possible, with as much DBMS
> as possible, starting and testing with Mysql and Postgresql.
> Appli is Java + JDBC.
>

What about just using the types inet or cidr for your task?
Oth, instead of (mis-) using OID datatype as unsigned int,
and converting it each time into int8 when you want
operations with it - why not using int8 for all?
It has 7*8+7 bits in the positive range, which should be
sufficient for values never bigger then 2^32.
But according to your task, its probably really better
to use inet/cidr types. Much lesser work I guess. And
ipv6 for grant :)

Regards
Tino Wildenhain

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2004-03-20 18:56:04 Re: Triggers After INSERT
Previous Message Jan Wieck 2004-03-20 16:11:11 Re: How reliable are the stats collector stats?