Re: String manipulation - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: String manipulation
Date
Msg-id 20040217193246.GB28099@wolff.to
Whole thread Raw
In response to String manipulation  (pativo@arcor.de (pativo))
List pgsql-general
On Tue, Feb 17, 2004 at 03:46:53 -0800,
  pativo <pativo@arcor.de> wrote:
> Hello to all,
>
> I have small problem. I have some database fields (VARCHAR)
> and these field should hold some ahex coded values. So the
> string length must be even and each character can only be
> 0-9, a-f or A-F.

You can use a constraint that checks the value versus a regular
expression. Something like: ~ '^([0-9a-fA-F][0-9a-fA-F])+$^'
Unless the 150 character limit is a real business rule, you probably
want to use TEXT instead of VARCHAR(150).

pgsql-general by date:

Previous
From: Jan Wieck
Date:
Subject: Re: PostgreSQL License
Next
From: Mike Nolan
Date:
Subject: Re: how to merge a table from another DB