Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m8jpG-0005vN-Ao for pgsql-bugs@arkaria.postgresql.org; Wed, 28 Jul 2021 13:42:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m8jpF-0002F2-9u for pgsql-bugs@arkaria.postgresql.org; Wed, 28 Jul 2021 13:42:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m8jnS-00059E-IZ for pgsql-bugs@lists.postgresql.org; Wed, 28 Jul 2021 13:40:30 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m8jnQ-0006lT-8I for pgsql-bugs@lists.postgresql.org; Wed, 28 Jul 2021 13:40:29 +0000 Received: by mail-pj1-x1030.google.com with SMTP id j1so5165763pjv.3 for ; Wed, 28 Jul 2021 06:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=6/9sgayFR+H6qWqL5veqeZx63gQJ/XMLJQHCdjZqX+o=; b=C9XUScWwq6Wti4Ifr3SWbddoX0g1eaQkgX7CQExvwwVCszUozq+sZjQqh8jTIhQNDt wmNf9ypGrfYDruTZbXF0XXyF0OLdYjdpg0OQB8RbzKU6KXK4KHZWeKxkLUoPIDUyQMwe A9peEWhy1hzd9gi+D0Q5VQzRfyvhztcFm7sJHuQ8fiaLKJmbfNxKZTt1BoSiAsirxXtS 7OXU8aTXQC5SEpRYIxChLxYnEC/SxEESTntKaDk+ml+5tajN1tfljLNYpSHjm9I+Evze s3iHYiwbkfi2Ihu43abXcd5NlDEsSlqdQNHSvSaMHVrlansF+fVjxFzoEWcq6i8lS+QZ 6Tug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=6/9sgayFR+H6qWqL5veqeZx63gQJ/XMLJQHCdjZqX+o=; b=t6Xz5dqCnAsjIOV1R9LXDIYPp2P5WXMlf2+G3R+mvy1SFmomHZQu6qDt0GEbTxgNtT 1XBFMRst10gXPA4KKoNLnOtX81bqxyYycpU7fqdIQOhnt20qlDhlJEgPrvzmMoRzsnL1 tHS5WNaJ1aNUlUofI4o03BebZFFHTFZehgSrcWLRVWF3x0Scw7ybq4vdARvN3s+6t+ku 5e2h5yAYjxqXMxcf0kh2nOEledDqUnIQGG3S4q0e/D7GY2hh0KXcnZzwbCdlBmYyJ5N8 YOhZV8Z1qgiWIeNqZr28vgmiSeI9VT0a5WASyxewxXREp/Yko2RPeOI4ur8flPFWihlb JCaA== X-Gm-Message-State: AOAM530sxSoPEdyr2o6JYqSTu36Y3u623Tb6QysAecNUAGemb6fpq4ng Wxqv/CNpbD+h4ouXPXlm3NR8wh7GvjW28xZnwMzgHXnO X-Google-Smtp-Source: ABdhPJw/I1JLjVCGEsOhKRRYNW6M5LIwbjl1PHnMR8zoRwzjDuA4Hq+ldhJeO24byeSdDfnlYJsWwxc56AASpK1QybI= X-Received: by 2002:a17:90b:3653:: with SMTP id nh19mr9640852pjb.169.1627479626393; Wed, 28 Jul 2021 06:40:26 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90b:e15:0:0:0:0 with HTTP; Wed, 28 Jul 2021 06:40:25 -0700 (PDT) In-Reply-To: <17125-483838072f5f4bac@postgresql.org> References: <17125-483838072f5f4bac@postgresql.org> From: "David G. Johnston" Date: Wed, 28 Jul 2021 06:40:25 -0700 Message-ID: Subject: Re: BUG #17125: Operator precedence bug in websearch_to_tsquery function To: "tim.connolly@oovvuu.com" , "pgsql-bugs@lists.postgresql.org" Content-Type: multipart/alternative; boundary="00000000000002ac1f05c82f217f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000002ac1f05c82f217f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, July 27, 2021, PG Bug reporting form wrote: > > postgres=3D# select websearch_to_tsquery('english', 'foo bar or baz'); > websearch_to_tsquery > ----------------------- > 'foo' & 'bar' | 'baz' > (1 row) > > Expected: 'foo' & ('bar' | 'baz') > > The documentation describes the operator precedence and it isn=E2=80=99t wh= at you expect. https://www.postgresql.org/docs/current/datatype-textsearch.html#DATATYPE-T= SQUERY David J. --00000000000002ac1f05c82f217f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, July 27, 2021, PG Bug reporting form <noreply@postgresql.org> wrote:

postgres=3D# select websearch_to_tsquery('english', 'foo b= ar or baz');
=C2=A0websearch_to_tsquery
-----------------------
=C2=A0'foo' & 'bar' | 'baz'
(1 row)

Expected: 'foo' & ('bar' | 'baz')


The documentation describes the operator p= recedence and it isn=E2=80=99t what you expect.



David J.

--00000000000002ac1f05c82f217f--