SV: where clauses including timstamptz and intervals

2021-04-15 Thread Niels Jespersen
>-Oprindelig meddelelse- >Fra: Francisco Olarte >Sendt: 10. april 2021 09:31 >Til: Niels Jespersen > >Although it is equivalent I would suggest to use: > >f.r_time< ('2020-10-01 00:00:00+00'::timestamptz at time zone 'utc' + interval >'1 month') at time zone 'utc' ; > >optimizer should

Re: where clauses including timstamptz and intervals

2021-04-10 Thread Francisco Olarte
Niels: On Fri, Apr 9, 2021 at 7:39 PM Niels Jespersen wrote: > The answer to my original problem behind my original question which is how to > query using utc timing in order to hit exactly the (utc created) partition, > without changing the session timezone, would be like this: You would hav

SV: where clauses including timstamptz and intervals

2021-04-09 Thread Niels Jespersen
>-Oprindelig meddelelse- >Fra: Tom Lane >Emne: Re: where clauses including timstamptz and intervals > >Ron writes: >> On 4/9/21 5:24 AM, hubert depesz lubaczewski wrote: >>> For example, in my timezone: >>> >>> (1 row) >>>

Re: where clauses including timstamptz and intervals

2021-04-09 Thread Francisco Olarte
Ron: On Fri, Apr 9, 2021 at 5:53 PM Ron wrote: > >> Are these two queries exactly eqivalent? The table is partitioned on > >> r_time, which is a timestamptz. The explain plans are not exactly the > >> same. The first wants to scan a partition more than the latter. > >> > >> select f.xx from f > >

Re: where clauses including timstamptz and intervals

2021-04-09 Thread Tom Lane
Ron writes: > On 4/9/21 5:24 AM, hubert depesz lubaczewski wrote: >> For example, in my timezone: >> >> $ select ('2020-10-01 00:00:00+00'::timestamptz + interval '1 month'), >> '2020-11-01 00:00:00+00'::timestamptz; >> ?column?│ timestamptz >> ┼─

Re: where clauses including timstamptz and intervals

2021-04-09 Thread Ron
On 4/9/21 5:24 AM, hubert depesz lubaczewski wrote: On Fri, Apr 09, 2021 at 07:24:54AM +, Niels Jespersen wrote: Hello all Are these two queries exactly eqivalent? The table is partitioned on r_time, which is a timestamptz. The explain plans are not exactly the same. The first wants to scan

Re: where clauses including timstamptz and intervals

2021-04-09 Thread hubert depesz lubaczewski
On Fri, Apr 09, 2021 at 07:24:54AM +, Niels Jespersen wrote: > Hello all > > Are these two queries exactly eqivalent? The table is partitioned on > r_time, which is a timestamptz. The explain plans are not exactly the > same. The first wants to scan a partition more than the latter. > > sele

where clauses including timstamptz and intervals

2021-04-09 Thread Niels Jespersen
Hello all Are these two queries exactly eqivalent? The table is partitioned on r_time, which is a timestamptz. The explain plans are not exactly the same. The first wants to scan a partition more than the latter. select f.xx from f where f.r_time >= '2020-10-01 00:00:00+00'::timestamptz an