Still a NOTICE in dict_thesaurus.c

Started by Tom Laneover 18 years ago7 messageshackers
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Wasn't this patch
http://archives.postgresql.org/pgsql-committers/2007-11/msg00170.php
supposed to fix things so that we wouldn't be throwing NOTICEs out of
tsearch dictionary init functions? It seems to have gotten only
one of the two elog(NOTICE) calls in there. The other one is for a
stopword in the replacement phrase. Is there any objection to making
that an ERROR too?

Also, several of the elog's in this file ought to be ereport's since
they are user-caused error conditions. I think we are nominally past
string freeze, but does anyone have an objection to changing them to
ereport's? If they don't get translated, the worst that will happen
is that they come out in English, which is what's happening now.

regards, tom lane

#2Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#1)
Re: Still a NOTICE in dict_thesaurus.c

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.

---------------------------------------------------------------------------

Tom Lane wrote:

Wasn't this patch
http://archives.postgresql.org/pgsql-committers/2007-11/msg00170.php
supposed to fix things so that we wouldn't be throwing NOTICEs out of
tsearch dictionary init functions? It seems to have gotten only
one of the two elog(NOTICE) calls in there. The other one is for a
stopword in the replacement phrase. Is there any objection to making
that an ERROR too?

Also, several of the elog's in this file ought to be ereport's since
they are user-caused error conditions. I think we are nominally past
string freeze, but does anyone have an objection to changing them to
ereport's? If they don't get translated, the worst that will happen
is that they come out in English, which is what's happening now.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

--
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. +

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#2)
Re: Still a NOTICE in dict_thesaurus.c

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.

regards, tom lane

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
Re: Still a NOTICE in dict_thesaurus.c

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?

--
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. +

#5Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#4)
Re: Still a NOTICE in dict_thesaurus.c

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. +

Attachments:

/rtmp/difftext/x-diffDownload+2-2
#6Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Bruce Momjian (#5)
Re: Still a NOTICE in dict_thesaurus.c

Bruce Momjian wrote:

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

FYI, at this time only the German and French translations have been
updated almost fully, and none of them is yet 100% in the backend
translation. I think it's appropriate to mark this string for
translation at this time (i.e. turn it into an ereport call).

--
Alvaro Herrera http://www.amazon.com/gp/registry/DXLWNGRJD34J
"Hay quien adquiere la mala costumbre de ser infeliz" (M. A. Evans)

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#6)
Re: Still a NOTICE in dict_thesaurus.c

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

FYI, at this time only the German and French translations have been
updated almost fully, and none of them is yet 100% in the backend
translation. I think it's appropriate to mark this string for
translation at this time (i.e. turn it into an ereport call).

Yeah, I saw a number of elogs that should be ereports in the tsearch
code during some idle looking yesterday. I'm planning to go through
it a bit more systematically today and fix what needs fixing.

regards, tom lane