date_part/extract parse curiosity - Mailing list pgsql-hackers

From Erik Rijkers
Subject date_part/extract parse curiosity
Date
Msg-id 1d5ff26f-f122-169b-eeff-abbaced85838@xs4all.nl
Whole thread Raw
Responses Re: date_part/extract parse curiosity
List pgsql-hackers
Hi,

I noticed that
   select date_part('millennium', now()); --> 3

will execute also, unperturbed, in this form:
   select date_part('millennium xxxxx', now()); --> 3

By the same token

   select extract(millennium from now()) --> 3
   select extract(millenniumxxxxxxxxx from now()) --> 3

This laxness occurs in all releases, and with 'millennium', 
'millisecond', and 'microsecond' (at least).

Even though it's not likely to cause much real-life headaches, and I 
hesitate to call it a real bug, perhaps it would be better if it could 
be a bit stricter.

Thanks,

Erik Rijkers



pgsql-hackers by date:

Previous
From: Ants Aasma
Date:
Subject: Re: Standby recovers records from wrong timeline
Next
From: Robert Haas
Date:
Subject: Re: Logical WAL sender unresponsive during decoding commit