From: | "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au> |
---|---|
To: | "Pgsql-Hackers" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Creating a 'SET' type |
Date: | 2000-12-13 05:02:17 |
Message-ID: | NEBBIOAJBMEENKACLNPCKEKJCCAA.chriskl@familyhealth.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
I am trying to emulate MySQL's SET type, by creating a new postgresql type.
However, is it possible to create a type that has different parameters
wherever it is used.
For instance - the varchar type takes as a parameter the max characters in
the field. Although there is only one varchar type, it has different
properties depending on whether or not it is varchar(5) or varchar(20).
I wish to be able to declare:
bitset('LOW','MEDIUM','HIGH') // Not sure of exact syntax
Internally stored as an int4.
The trouble is in writing the in and out functions. They need to be able to
store a list of token names in order to recreate the comma delimited list of
tokens from the internal bitset, and vice versa...
Any help?
Thanks,
Chris
--
Christopher Kings-Lynne
Family Health Network (ACN 089 639 243)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2000-12-13 05:20:20 | Re: external function proposal for 7.2 |
Previous Message | Tom Lane | 2000-12-13 04:56:22 | Re: Re: COPY BINARY file format proposal |