regular expression limit

From: Ron Peterson <ron(dot)peterson(at)yellowbank(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: regular expression limit
Date: 2007-01-02 03:52:59
Message-ID: 20070102035259.GB15601@yellowbank.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I believe there's been a change in PostgreSQL's regular expression
handling w/ 8.2.

CREATE TABLE testb (
name
TEXT
-- CHECK( name ~ '^[a-f0-9]{1,256}$' )
CHECK( name ~ '^[a-f0-9]{1,255}$' )
);

If I swap the two check statements above, I can no longer insert data.
The operation errors out with:

"invalid regular expression: invalid repetition count(s)"

I'd like the following domain statement to work. It used to work in
8.1.4, but not now. Can I do this in 8.2?

CREATE DOMAIN
__hex_string_8192
AS TEXT
CHECK ( VALUE ~ '^[a-f0-9]{1,8192}$' );

TIA.

--
Ron Peterson
https://www.yellowbank.com/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gurjeet Singh 2007-01-02 03:59:22 Re: spooky refusal to insert
Previous Message novnov 2007-01-02 02:24:32 Re: Installing support for python on windows