pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
regcomp failed with error empty (sub)expression?
2+ messages / 2 participants
[nested] [flat]

* regcomp failed with error empty (sub)expression?
@ 2000-12-22 05:37 Michael Miyabara-McCaskey <mykarz@miyabara.com>
  2000-12-22 06:06 ` Re: regcomp failed with error empty (sub)expression? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Michael Miyabara-McCaskey @ 2000-12-22 05:37 UTC (permalink / raw)
  To: pgsql-sql

Hello all,

I just discovered the regex (regular expression matching in PGSQL 7.0.3...
However, after trying to run my first query I got the following:

regcomp failed with error empty (sub)expression

Anys thoughts as to what this means?

The following SQL statement generated the error.

INSERT INTO table3(table1.oid,table2.oid)
  SELECT table1.oid, table2.oid
  FROM table1, table2
  WHERE table1.field1 ~* table2.field1
        table1.field2 ~* table2.field2
        table1.field3 = table2.field3
        table1.field4 = table2.field4;

Field 1 - 4 on both table 1 and table 2 are all "text", and table1 field1 &
2 are in Upper/Lower vs table2 field1 & 2 are in all UPPER.

I'm basically trying to do a simply comparison between table1 and table2 to
find duplicates, but the case differences are stopping me, and as the 7.0.3
version of "upper()" has memory leaks, and the Plperl verion of uc() that I
created takes A LONG time to run (I have a LOT of records)... here I am
trying to match strings with CASE differences.

Any help would be appreciated, as to what caused this error.

Michael Miyabara-McCaskey
Email: mykarz@miyabara.com
Web: http://www.miyabara.com/mykarz/
Mobile: +1 408 504 9014




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: regcomp failed with error empty (sub)expression?
  2000-12-22 05:37 regcomp failed with error empty (sub)expression? Michael Miyabara-McCaskey <mykarz@miyabara.com>
@ 2000-12-22 06:06 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2000-12-22 06:06 UTC (permalink / raw)
  To: mykarz@miyabara.com; +Cc: pgsql-sql

"Michael Miyabara-McCaskey" <mykarz@miyabara.com> writes:
> regcomp failed with error empty (sub)expression
> Anys thoughts as to what this means?

I'd say it means the regexp code doesn't like your pattern.  For
example, I can trigger that with

regression=# select 'abc' ~ '|33';
ERROR:  regcomp failed with error empty (sub)expression

'|33' is a bogus pattern because one side of the alternative
construct is empty.  ('|' is the OR pattern operator.)

> The following SQL statement generated the error.

> INSERT INTO table3(table1.oid,table2.oid)
>   SELECT table1.oid, table2.oid
>   FROM table1, table2
>   WHERE table1.field1 ~* table2.field1
>         table1.field2 ~* table2.field2
>         table1.field3 = table2.field3
>         table1.field4 = table2.field4;

Not very helpful when we don't know what's in the table2.field1 and
table2.field2 columns.

> I'm basically trying to do a simply comparison between table1 and table2 to
> find duplicates, but the case differences are stopping me, and as the 7.0.3
> version of "upper()" has memory leaks, and the Plperl verion of uc() that I
> created takes A LONG time to run (I have a LOT of records)... here I am
> trying to match strings with CASE differences.

If you are just trying to match without regard to case, the thing to do
is something like "upper(col1) = upper(col2)".  Using data as a regexp
or LIKE pattern is sheer folly, unless you are *certain* that it can
never contain pattern-operator characters.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2000-12-22 06:06 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-12-22 05:37 regcomp failed with error empty (sub)expression? Michael Miyabara-McCaskey <mykarz@miyabara.com>
2000-12-22 06:06 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox