pgsql: Fix support of digits in email/hostnames. - Mailing list pgsql-committers

From Teodor Sigaev
Subject pgsql: Fix support of digits in email/hostnames.
Date
Msg-id E1akva4-0003Zo-LI@gemulon.postgresql.org
Whole thread Raw
Responses Re: pgsql: Fix support of digits in email/hostnames.  (Bruce Momjian <bruce@momjian.us>)
List pgsql-committers
Fix support of digits in email/hostnames.

When tsearch was implemented I did several mistakes in hostname/email
definition rules:
1) allow underscore in hostname what prohibited by RFC
2) forget to allow leading digits separated by hyphen (like 123-x.com)
   in hostname
3) do no allow underscore/hyphen after leading digits in localpart of email

Artur's patch resolves two last issues, but by the way allows hosts name like
123_x.com together with 123-x.com. RFC forbids underscore usage in hostname
but pg allows that since initial tsearch version in core, although only
for non-digits. Patch syncs support digits and nondigits in both hostname and
email.

Forbidding underscore in hostname may break existsing usage of tsearch and,
anyhow, it should be done by separate patch.

Author: Artur Zakirov
BUG: #13964

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/61d66c44f18c73094a50a2ef97d26cc03e171dc0

Modified Files
--------------
src/backend/tsearch/wparser_def.c     |  3 +++
src/test/regress/expected/tsearch.out | 22 ++++++++++++++--------
src/test/regress/sql/tsearch.sql      |  6 +++---
3 files changed, 20 insertions(+), 11 deletions(-)


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Rework custom scans to work more like the new extensible node st
Next
From: Tom Lane
Date:
Subject: pgsql: Avoid possibly-unsafe use of Windows' FormatMessage() function.