Re: unexpected result from to_tsvector

From: Dmitrii Golub <dmitrii(dot)golub(at)gmail(dot)com>
To: Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: unexpected result from to_tsvector
Date: 2016-03-07 20:55:19
Message-ID: CAN1orqngpoLTTs8xjmzsRSjMXf8A2hYehBQs+WdvsP_F4NSxmw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2016-02-23 20:53 GMT+03:00 Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>:

> Hello,
>
> Here is a little patch. It fixes this issue
> http://www.postgresql.org/message-id/20160217080048.26357.49416@wrigleys.postgresql.org
>
> Without patch we get wrong result for the second email 'test(at)123-reg(dot)ro':
>
> => SELECT * FROM ts_debug('simple', 'test(at)vauban-reg(dot)ro');
> alias | description | token | dictionaries | dictionary |
> lexemes
>
> -------+---------------+--------------------+--------------+------------+----------------------
> email | Email address | test(at)vauban-reg(dot)ro | {simple} | simple | {
> test(at)vauban-reg(dot)ro}
> (1 row)
>
> => SELECT * FROM ts_debug('simple', 'test(at)123-reg(dot)ro');
> alias | description | token | dictionaries | dictionary |
> lexemes
>
> -----------+------------------+--------+--------------+------------+----------
> asciiword | Word, all ASCII | test | {simple} | simple | {test}
> blank | Space symbols | @ | {} | |
> uint | Unsigned integer | 123 | {simple} | simple | {123}
> blank | Space symbols | - | {} | |
> host | Host | reg.ro | {simple} | simple | {
> reg.ro}
> (5 rows)
>
> After patch we get correct result for the second email:
>
> => SELECT * FROM ts_debug('simple', 'test(at)123-reg(dot)ro');
> alias | description | token | dictionaries | dictionary |
> lexemes
>
> -------+---------------+-----------------+--------------+------------+----------------------
> email | Email address | test(at)123-reg(dot)ro | {simple} | simple | {
> test(at)123-reg(dot)ro}
> (1 row)
>
> This patch allows to parser work with emails 'test(at)123-reg(dot)ro', '
> 123(at)123-reg(dot)ro' and 'test(at)123_reg(dot)ro' correctly.
>
> --
> Artur Zakirov
> Postgres Professional: http://www.postgrespro.com
> Russian Postgres Company
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>
>
Hello,

Should we added tests for this case?

123_reg.ro is not valid domain name, bacause of symbol "_"

https://tools.ietf.org/html/rfc1035 page 8.

Dmitrii Golub

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-03-07 21:01:15 Re: WIP: Upper planner pathification
Previous Message Igal @ Lucee.org 2016-03-07 20:51:26 Re: Proposal: RETURNING primary_key()