Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id CBA74116AE57 for ; Tue, 3 Jan 2012 14:04:39 -0400 (AST) Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ri8ix-0000w2-QD for pgsql-bugs@postgresql.org; Tue, 03 Jan 2012 18:04:39 +0000 Received: from [204.145.120.229] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ri8il-0000es-Kc for pgsql-bugs@postgresql.org; Tue, 03 Jan 2012 18:04:23 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1Ri8il-0008Ct-9p for pgsql-bugs@postgresql.org; Tue, 03 Jan 2012 18:04:23 +0000 Date: Tue, 03 Jan 2012 18:04:23 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #6375: tsearch does not recognize all valid emails To: pgsql-bugs@postgresql.org From: valgog@gmail.com X-Pg-Spam-Score: -3.7 (---) X-Archive-Number: 201201/13 X-Sequence-Number: 32080 The following bug has been logged on the website: Bug reference: 6375 Logged by: Valentine Gogichashvili Email address: valgog@gmail.com PostgreSQL version: 9.1.1 Operating system: Debian 4.4.5-8 Description: = Hello, = default tsearch parser does not recognize all valid email addresses and tokenizes them as text, splitting into tokens. = For example: postgres=3D# select to_tsquery('simple', 'normal@email.com' ); to_tsquery = =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80 'normal@email.com' (1 row) here it behaves ok; postgres=3D# select to_tsquery('simple', '-still-normal@email.com' ); to_tsquery = =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80 'still-normal@email.com' (1 row) here it trims '-' from the beginning of an email. This is not correct, but will at least find that email. postgres=3D# select to_tsquery('simple', '-not-normal-with-dash-@email.com' ); to_tsquery = = =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80 'not-normal-with-dash' & 'not' & 'normal' & 'with' & 'dash' & 'email.com' (1 row) and this is now a real problem as it leads to finding emails that are not the same, but are "super-sets" of that one. Valid email characters, that are not correctly treated also are at least '+' and '.' With my best regards, = -- Valentine Gogichashvili =