regular expression limit - Mailing list pgsql-general

From Ron Peterson
Subject regular expression limit
Date
Msg-id 20070102035259.GB15601@yellowbank.com
Whole thread Raw
Responses Re: regular expression limit  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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/

pgsql-general by date:

Previous
From: novnov
Date:
Subject: Re: Installing support for python on windows
Next
From: "Gurjeet Singh"
Date:
Subject: Re: spooky refusal to insert