Re: date_part/extract parse curiosity

2022-10-20 Thread Japin Li
On Thu, 20 Oct 2022 at 22:12, Tom Lane wrote: > Japin Li writes: >> On Thu, 20 Oct 2022 at 20:45, Erik Rijkers wrote: >>> I noticed that >>> select date_part('millennium', now()); --> 3 >>> >>> will execute also, unperturbed, in this form: >>> select date_part('millennium x', now()); -->

Re: date_part/extract parse curiosity

2022-10-20 Thread Tom Lane
Japin Li writes: > On Thu, 20 Oct 2022 at 20:45, Erik Rijkers wrote: >> I noticed that >> select date_part('millennium', now()); --> 3 >> >> will execute also, unperturbed, in this form: >> select date_part('millennium x', now()); --> 3 > Maybe we should document this. I'd be inclined to c

Re: date_part/extract parse curiosity

2022-10-20 Thread Japin Li
On Thu, 20 Oct 2022 at 20:45, Erik Rijkers wrote: > Hi, > > I noticed that > select date_part('millennium', now()); --> 3 > > will execute also, unperturbed, in this form: > select date_part('millennium x', now()); --> 3 > > By the same token > > select extract(millennium from now()) -

date_part/extract parse curiosity

2022-10-20 Thread Erik Rijkers
Hi, I noticed that select date_part('millennium', now()); --> 3 will execute also, unperturbed, in this form: select date_part('millennium x', now()); --> 3 By the same token select extract(millennium from now()) --> 3 select extract(millenniumx from now()) --> 3 This laxn