On Sun, Dec 01, 2024 at 03:09:17PM -0500, Joseph Koshakow wrote:
> When looking at the date_trunc function, I noticed that it wasn't
> rejecting invalid units if the value was infinite. It's slightly
> annoying to fix this, but we already do something very similar for
> date_part. I have attached a patch that would fix this issue, let me
> know if you think it's worth pursuing.

I agree that it is inconsistent that we allow infinite values to go
through this function call even for fields that are not listed as
supported by the documentation.  So, yes, I think that what you are
doing the right thing by applying the check based on the units
supported, but I also doubt that it is something that we could
backpatch as it would cause queries to work now to suddenly break.

Thoughts and comments from others are welcome.
--
Michael

Attachment: signature.asc
Description: PGP signature

Reply via email to