2016-02-23 20:53 GMT+03:00 Artur Zakirov <a.zaki...@postgrespro.ru>:

> Hello,
>
> Here is a little patch. It fixes this issue
> http://www.postgresql.org/message-id/20160217080048.26357.49...@wrigleys.postgresql.org
>
> Without patch we get wrong result for the second email 't...@123-reg.ro':
>
> => SELECT * FROM ts_debug('simple', 't...@vauban-reg.ro');
>  alias |  description  |       token        | dictionaries | dictionary |
>      lexemes
>
> -------+---------------+--------------------+--------------+------------+----------------------
>  email | Email address | t...@vauban-reg.ro | {simple}     | simple  | {
> t...@vauban-reg.ro}
> (1 row)
>
> => SELECT * FROM ts_debug('simple', 't...@123-reg.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', 't...@123-reg.ro');
>  alias |  description  |      token      | dictionaries | dictionary |
>    lexemes
>
> -------+---------------+-----------------+--------------+------------+----------------------
>  email | Email address | t...@123-reg.ro | {simple}     | simple  | {
> t...@123-reg.ro}
> (1 row)
>
> This patch allows to parser work with emails 't...@123-reg.ro', '
> 1...@123-reg.ro' and 'test@123_reg.ro' correctly.
>
> --
> Artur Zakirov
> Postgres Professional: http://www.postgrespro.com
> Russian Postgres Company
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.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

Reply via email to