Re: semi-variable length type - Mailing list pgsql-general

From James Harper
Subject Re: semi-variable length type
Date
Msg-id 6035A0D088A63A46850C3988ED045A4B6F3AE2ED@BITCOM1.int.sbss.com.au
Whole thread Raw
In response to Re: semi-variable length type  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: semi-variable length type  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
>
> James Harper <james.harper@bendigoit.com.au> writes:
> > I want to make a float(n) type that emulates the mssql float type. The
> > storage requirements are documented as 4 bytes for 1 <= n <=24, and 8
> > bytes for 25 <= n <= 53.
>
> Haven't we got that already?
>
> regression=# create table t1 (f1 float(5), f2 float(30));
> CREATE TABLE
> regression=# \d t1
>            Table "public.t1"
>  Column |       Type       | Modifiers
> --------+------------------+-----------
>  f1     | real             |
>  f2     | double precision |
>
> Other than the fact that we don't remember whether you asked for 5 bits
> or 24, I think this meets the spec requirements.
>

Is the 4 byte or 8 byte decision based on (n) implemented in the parser? I can't see a 'float' type in pg_type.

Thanks

James


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: semi-variable length type
Next
From: Torsten Förtsch
Date:
Subject: How to continue streaming replication after this error?