custom type for storing a HTML color

From: "Justin Dearing" <zippy1981(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: custom type for storing a HTML color
Date: 2007-03-27 21:10:59
Message-ID: 5458db3c0703271410u5a7815d6j957ed4a5e54a5c0b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello, I currently store html color codes in that database with the
following DOMAIN:

CREATE DOMAIN html_color AS char(7) CHECK (VALUE ~ '^#[A-Fa-f0-9]{6}$');

Has anyone created a custom type that has additional functionality (eg
format the input or output to other formats, retrieve red, green or
blue values as 0-255 integers, etc. This is good enough for my uses at
the moment, but has anyone invented a better wheel than mine?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Browne 2007-03-27 21:34:28 Re: Is there a shortage of postgresql skilled ops people
Previous Message Scott Marlowe 2007-03-27 21:10:12 Re: Is there a shortage of postgresql skilled ops people