Re: substring and POSIX re's

From: Don Isgitt <djisgitt(at)soundenergy(dot)com>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, postgresql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: substring and POSIX re's
Date: 2005-04-19 18:40:52
Message-ID: 426550B4.1040002@soundenergy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Fuhr wrote:

>On Tue, Apr 19, 2005 at 12:39:52PM -0400, Alvaro Herrera wrote:
>
>
>>On Tue, Apr 19, 2005 at 10:03:45AM -0600, Michael Fuhr wrote:
>>
>>
>>>On Tue, Apr 19, 2005 at 11:17:46AM -0500, Don Isgitt wrote:
>>>
>>>
>>>>Thanks, Tom. Interestingly enough, neither my original query or your
>>>>corrected one returns anything with pg 7.4--another good reason to
>>>>upgrade to 8.*
>>>>
>>>>
>>>Hmmm...for me both queries give the results shown if I run them in
>>>7.3.9, 7.4.7, 8.0.2, or 8.1devel. What's different about your 7.4
>>>installation?
>>>
>>>
>>Maybe the regex_flavor setting? (not sure of the exact name)
>>
>>
>
>Ah yes, I forgot about that....
>
>test=> SET regex_flavor TO basic;
>SET
>test=> SELECT substring('NE NE SE 2310 FSL 330 FEL' FROM '^(([A-Z][A-Z] )+)');
> substring
>-----------
>
>(1 row)
>
>test=> SET regex_flavor TO advanced;
>SET
>test=> SELECT substring('NE NE SE 2310 FSL 330 FEL' FROM '^(([A-Z][A-Z] )+)');
> substring
>-----------
> NE NE SE
>(1 row)
>
>test=> SELECT version();
> version
>---------------------------------------------------------------------------
> PostgreSQL 7.4.7 on sparc-sun-solaris2.9, compiled by GCC gcc (GCC) 3.4.2
>(1 row)
>
>
>
Thank you, Alvaro and Michael,

The regex_flavor setting was the culprit; I never knew of such a
creature in pg! Mystery solved. The members on this board are great.

Don

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2005-04-19 18:45:44 Re: Help! "Access is Denied" Installation on WinXP rolled
Previous Message Tom Lane 2005-04-19 18:37:54 Re: Simplified (a-la [G|N]DBM) DB access