Re: Prefix support for synonym dictionary - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Prefix support for synonym dictionary
Date
Msg-id 603c8f070908060919o5151741aq3af69fff573ea83e@mail.gmail.com
Whole thread Raw
In response to Re: Prefix support for synonym dictionary  (Teodor Sigaev <teodor@sigaev.ru>)
Responses Re: Prefix support for synonym dictionary
List pgsql-hackers
2009/8/6 Teodor Sigaev <teodor@sigaev.ru>:
>> 1. The docs should be clarified a little. For instance, it should have a
>> link back to the definition of a prefix search (12.3.2). I included my
>> doc suggestions as an attachment.
>
> Thank you, merged
>
>> 2. dsynonym_init() uses findwrd() in a slightly confusing (and perhaps
>> fragile) way. After calling findwrd(), the "end" pointer is pointing at
>> either the end of the string, or the *; depending on whether the string
>> ends in * and whether flags is NULL. I only mention this because I had
>> to take a more careful look to see what was happening. Perhaps add a
>> comment to make it more clear?
>
> Add comments:
> /*
>  * Finds the next whitespace-delimited word within the 'in' string.
>  * Returns a pointer to the first character of the word, and a pointer
>  * to the next byte after the last character in the word (in *end).
>  * Character '*' at the end of word will not be threated as word
>  * charater if flags is not null.
>  */
> static char *
> findwrd(char *in, char **end, uint16 *flags)
>
>
>
>> 3. The patch looks for the special byte '*'. I think that's fine,
>> because we depend on the files being in UTF-8 encoding, where it's the
>> same byte. However, I thought it was worth mentioning in case we want to
>> support other encodings for text search files later.
>
> tsearch_readline() converts file's UTF8 encoding into server encoding. pgsql
> supports only encoding which are a superset of ASCII. So it's safe to use
> asterisk with any encodings

Jeff,

Based on these comments, do you want to go ahead and mark this "Ready
for Committer"?

https://commitfest.postgresql.org/action/patch_view?id=133

...Robert


pgsql-hackers by date:

Previous
From: Teodor Sigaev
Date:
Subject: Re: Prefix support for synonym dictionary
Next
From: Andrew Dunstan
Date:
Subject: Re: dblink bulk operations