Sender: owner-postgres95@postgres.Berkeley.EDU
X-Return-Path: andrew_yu
Received: from lounix4.conc.tdsnet.com (root@[204.246.5.162]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with ESMTP id OAA14694 for <postgres95@nobozo.CS.Berkeley.EDU>; Tue, 14 Nov 1995 14:35:05 -0800
Received: from lounix4.conc.tdsnet.com (lou@localhost [127.0.0.1]) by lounix4.conc.tdsnet.com (8.6.12/8.6.9) with SMTP id RAA00412 for <postgres95@nobozo.CS.Berkeley.EDU>; Tue, 14 Nov 1995 17:36:13 -0500
Date: Tue, 14 Nov 1995 17:36:10 -0500 (EST)
From: Lou Sortman <lou@ncinfo.iog.unc.edu>
To: postgres <postgres95@postgres.Berkeley.EDU>
Subject: Re: Regexp library reports error 50 (Solaris 2.4, Sparc, postgres , 1.0pl14)
In-Reply-To: <Pine.SV4.3.91.951114235634.3541A-100000@ra>
Message-ID: <Pine.LNX.3.91.951114172317.297F-100000@lounix4.conc.tdsnet.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Resent-To: postgres95-redist
Resent-Date: Tue, 14 Nov 95 14:35:08 -0800
Resent-From: pglite
Resent-XMts: smtp

On Wed, 15 Nov 1995, O.Bartunov wrote:

> Hello,
> anybody know how to get postgres work properly with regexp under Solaris 2.4 ?
> Here is the protocol:
> 
> query SELECT Organ, Name, Dolznost, Address, phone, fax, email FROM edid 
> WHERE Dolznost ~ '[Ff][Oo][Rr][Mm][Ee][Rr] [Pp][Rr][Ee][Ss][Ii][Dd][Ee][Nn][Tt]'
> 
> produced the error WARN:regexp library reports error 50 
> 
> It works fine if request is one word like '[Ff][Oo][Rr][Mm][Ee][Rr]'.

I ran into this too.  My bet is that you have to go into 
src/backend/utils/adt/regexp.c and increase the size of EXPBUFSZ.  The 
problem is that your expression is very complicated and takes up more than 
the current 256 bytes when compiled.

Of course, increasing the buffer 
size only postpones the inevitable.  The real solution is to exploit the 
fact that the implementation of regcmp in Solaris will allocate a 
correctly sized buffer when fed an address of NULL.  I made this 
modification on mine (a version prior to 1.0) and it works fine.  
Unfortunately, not all implementations have this feature, so it would 
have to be #ifdef'ed or emulated for those.

===============================================================================
  To unsubscribe from the Postgres95 mailing list, send mail with the subject
  line "DEL" to "postgres95-request@postgres.Berkeley.EDU". 
============  URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres95/  ===========
