semi-variable length type - Mailing list pgsql-general

From James Harper
Subject semi-variable length type
Date
Msg-id 6035A0D088A63A46850C3988ED045A4B6F3AE0D1@BITCOM1.int.sbss.com.au
Whole thread Raw
Responses Re: semi-variable length type  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I want to make a float(n) type that emulates the mssql float type. The storage requirements are documented as 4 bytes
for1 <= n <=24, and 8 bytes for 25 <= n <= 53. If I understand correctly, my options for emulating this in postgres
are:

1. declare as variable length. Storage is then 8 bytes (4 byte length + 4 byte storage), or 12 bytes (4 byte length + 8
bytestorage). 

2. declare as fixed 8 byte length.

In the absence of some magical 3rd option, I assume #2 is the best way forward... can anyone confirm?

Thanks

James


pgsql-general by date:

Previous
From: mark_2014
Date:
Subject: table "db1.public.a" and all behind "db1.public.a" tables did not do analyzing
Next
From: Tom Lane
Date:
Subject: Re: semi-variable length type