Re: Still a NOTICE in dict_thesaurus.c - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Still a NOTICE in dict_thesaurus.c
Date
Msg-id 200711280425.lAS4P7D29700@momjian.us
Whole thread Raw
In response to Re: Still a NOTICE in dict_thesaurus.c  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Still a NOTICE in dict_thesaurus.c  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
Bruce Momjian wrote:
> Tom Lane wrote:
> > Bruce Momjian <bruce@momjian.us> writes:
> > > Thanks, working on this now.  Because the stop words can be any stop
> > > word I didn't imagine it could be in the subsitution.  What stop word
> > > will it use?  Anyway, coding it now to match the left-hand-side.
> >
> > Why would you do that?  There is not any corresponding idea of leaving
> > holes in the pattern.  AFAICS the only change needed is NOTICE->ERROR.
>
> OK, I see now.  The right-hand side just ignores a stop word, rather
> than accepting any stop word.  Got it.
>
> So, for the left-hand-side we have '?' as any stop word and a stop word
> as an error, and you want to make a stop word as an error on the
> right-hand-size.  No need for '?'.  Agreed.  Want me to do it?

I have applied the attached patch to change the NOTICE to ERROR.  Thanks
for spotting this.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: src/backend/tsearch/dict_thesaurus.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/tsearch/dict_thesaurus.c,v
retrieving revision 1.8
diff -c -c -r1.8 dict_thesaurus.c
*** src/backend/tsearch/dict_thesaurus.c    15 Nov 2007 22:25:16 -0000    1.8
--- src/backend/tsearch/dict_thesaurus.c    28 Nov 2007 04:22:08 -0000
***************
*** 570,576 ****
              }
              else if (lexized)
              {
!                 elog(NOTICE, "thesaurus word \"%s\" in substitution is a stop-word, ignored (rule %d)",
inptr->lexeme,i + 1); 
              }
              else
              {
--- 570,576 ----
              }
              else if (lexized)
              {
!                 elog(ERROR, "thesaurus word \"%s\" in substitution is a stop-word (rule %d)", inptr->lexeme, i + 1);
              }
              else
              {

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Quality and Performance
Next
From: Robert Treat
Date:
Subject: Re: Poorly designed tsearch NOTICEs