Precedence of bitwise operators

2022-11-20 Thread Bauyrzhan Sakhariyev
Hi! Do I get it right, that bitwise operations have the same precedence? Query *SELECT 1 & 2 | 3, 3 | 1 & 2* returns 3 and 2 respectively. See also https://www.db-fiddle.com/f/iZHd8zG7A1HjbB6J2y8R7k/1. It looks like the result is calculated from left to right and operators have the same precedence

Re: truncating timestamps on arbitrary intervals

2021-07-22 Thread Bauyrzhan Sakhariyev
ant to align CrateDB date_bin <https://github.com/crate/crate/issues/11310> with Postgresql On Thu, Jul 22, 2021 at 7:28 PM John Naylor wrote: > > On Thu, Jul 22, 2021 at 12:24 PM Bauyrzhan Sakhariyev < > baurzhansahar...@gmail.com> wrote: > > > > Is date_bin suppo

Re: truncating timestamps on arbitrary intervals

2021-07-22 Thread Bauyrzhan Sakhariyev
Is date_bin supposed to return the beginning of the bin? And does the sign of an interval define the "direction" of the bin? Judging by results of queries #1 and #2, sign of interval decides a direction timestamp gets shifted to (in both cases ts < origin) but when ts >origin (queries #3 and #4) in