From: | Teodor Sigaev <teodor(at)sigaev(dot)ru> |
---|---|
To: | obartunov(at)gmail(dot)com, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Precedence of new phrase search tsquery operator |
Date: | 2016-06-21 14:34:16 |
Message-ID: | 57695068.9080401@sigaev.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> On Wed, Jun 8, 2016 at 7:13 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> It appears that the new <-> operator has been made to have exactly the
>> same grammatical precedence as the existing & (AND) operator. Thus,
>> for example, 'a & b <-> c'::tsquery means something different from
>> 'b <-> c & a'::tsquery:
>> I find this surprising. My intuitive feeling is that <-> ought to
>> bind tighter than & (and therefore also tighter than |). What's
>> the reasoning for making it act like this?
>
> ah, now we remember :) The idea about equivalence of & and <->
> operators appeared in situation when <-> degenerates to & in case of
> absence of positional information. Looks like we mixed different
> things, will fix.
Attached patch changes a precedences of operations to |, &, <->, | in ascending
order. BTW, it simplifies a bit a code around printing and parsing of tsquery.
--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/
Attachment | Content-Type | Size |
---|---|---|
phrase_predecence-2.patch | binary/octet-stream | 16.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2016-06-21 14:38:10 | Re: Reviewing freeze map code |
Previous Message | Tom Lane | 2016-06-21 13:46:22 | Re: Missing checks when malloc returns NULL... |