Re: [HACKERS] Re: [GENERAL] Update of bitmask type

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>, Hannu Krosing <hannu(at)tm(dot)ee>, Postgresql <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Re: [GENERAL] Update of bitmask type
Date: 1999-09-27 00:44:42
Message-ID: 199909270044.UAA27257@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> attypmod has been modified recently to contain two fields (each of 16
> bits) in a backward-compatible way. It can hold the size *and*
> precision of the numeric data types, and presumably should be used in
> a similar manner for your bit type.

You can use a union to split atttypmod up into two 8-bit fields and on
16-bit field. Let me know if you need help.

>
> The problem is that you need another field which contains a length in
> bit units. Assuming that the second field in attypmod can't be used
> for this purpose, then istm that you will want to add a field to the
> data type itself. The character types have:
>
> length - total size of data, in bytes (4 bytes)
> data - body
>
> and you might have
>
> length - total size of data, in bytes (4 bytes)
> blen - total size of data, in bits (4 bytes)
> data - body
>
> - Thomas
>
> --
> Thomas Lockhart lockhart(at)alumni(dot)caltech(dot)edu
> South Pasadena, California
>
> ************
>
>

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Kwan 1999-09-27 05:38:54 Help: Choosing PostgreSQL vs MySQL
Previous Message Bruce Momjian 1999-09-27 00:33:01 Re: [GENERAL] FATAL 1: Memory exhausted in AllocSetAlloc()

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-09-27 00:47:04 Re: [HACKERS] int8 and index
Previous Message Bruce Momjian 1999-09-27 00:31:26 Re: [HACKERS] libpq.rc for Win32