Re: Quering by Regular Expressions stored in table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Allen Fair <dba(at)girders(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Quering by Regular Expressions stored in table
Date: 2006-05-23 16:14:31
Message-ID: 15094.1148400871@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Allen Fair <dba(at)girders(dot)org> writes:
> Hi! I have a table with a character column (called match_regex)
> containing a POSIX regular expression, hoping to have Postgres use it
> while evaluating the "where" predicate. The following error occurs:

> SELECT *
> from patterns
> where 'blah blah blah' ~ match_regex;

> ERROR: invalid regular expression: quantifier operand invalid

This means there's at least one value in the column that's not a legal
regex (* at the front is one possible cause, IIRC).

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rafal Pietrak 2006-05-23 16:44:55 Re: background triggers?
Previous Message Allen Fair 2006-05-23 16:11:33 Re: Quering by Regular Expressions stored in table