Hello,
Here is a little patch. It fixes this issue
http://www.postgresql.org/message-id/[email protected]
Without patch we get wrong result for the second email '[email protected]':
=> SELECT * FROM ts_debug('simple', '[email protected]');
alias | description | token | dictionaries | dictionary
| lexemes
-------+---------------+--------------------+--------------+------------+----------------------
email | Email address | [email protected] | {simple} | simple |
{[email protected]}
(1 row)
=> SELECT * FROM ts_debug('simple', '[email protected]');
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', '[email protected]');
alias | description | token | dictionaries | dictionary |
lexemes
-------+---------------+-----------------+--------------+------------+----------------------
email | Email address | [email protected] | {simple} | simple |
{[email protected]}
(1 row)
This patch allows to parser work with emails '[email protected]',
'[email protected]' and 'test@123_reg.ro' correctly.
--
Artur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company
*** a/src/backend/tsearch/wparser_def.c
--- b/src/backend/tsearch/wparser_def.c
***************
*** 1121,1126 **** static const TParserStateActionItem actionTPS_InUnsignedInt[] = {
--- 1121,1129 ----
{p_iseqC, '.', A_PUSH, TPS_InUDecimalFirst, 0, NULL},
{p_iseqC, 'e', A_PUSH, TPS_InMantissaFirst, 0, NULL},
{p_iseqC, 'E', A_PUSH, TPS_InMantissaFirst, 0, NULL},
+ {p_iseqC, '-', A_PUSH, TPS_InHostFirstAN, 0, NULL},
+ {p_iseqC, '_', A_PUSH, TPS_InHostFirstAN, 0, NULL},
+ {p_iseqC, '@', A_PUSH, TPS_InEmail, 0, NULL},
{p_isasclet, 0, A_PUSH, TPS_InHost, 0, NULL},
{p_isalpha, 0, A_NEXT, TPS_InNumWord, 0, NULL},
{p_isspecial, 0, A_NEXT, TPS_InNumWord, 0, NULL},
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers