Re: String manipulation

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: String manipulation
Дата
Msg-id 20040217193246.GB28099@wolff.to
обсуждение исходный текст
Ответ на String manipulation  (pativo@arcor.de (pativo))
Список 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 по дате отправления:

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: PostgreSQL License
Следующее
От: Mike Nolan
Дата:
Сообщение: Re: how to merge a table from another DB