[postgis-devel] Typmod Again

Paul Ramsey pramsey at cleverelephant.ca
Wed Jul 22 17:36:44 PDT 2009


On Wed, Jul 22, 2009 at 5:18 PM, Stephen Frost<sfrost at snowman.net> wrote:
> * Paul Ramsey (pramsey at cleverelephant.ca) wrote:
>> 32 bits:
>> Top 24 bits for SRID,
>> Middle 6 bits for Type,
>> Bottom 2 bits for Z/M flags.
>
> Don't we only get 31 bits, since returning a negative value for typmod
> is an indication of failure?

Bloody heck, you're right... the best laid plans... well, I could
squeeze type down to 5 bits (32 possibilities) or srid down to 23 bits
(8388608 possibilities). Any preferences? (We currently only use 4
bits for type, so this still an improvement, and official EPSG codes
still don't exceed 65536.)

P.



More information about the postgis-devel mailing list