Bug report function to_date should reject HH24:MI:SS formatting options

From: Sébastien Caunes <sebastien(at)pixseed(dot)fr>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Bug report function to_date should reject HH24:MI:SS formatting options
Date: 2021-09-30 09:03:14
Message-ID: CANtq+vRSFrA6R7X1KXkiMVL7=uQFfEWjkKC=o8r358ySiNTMig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello,

It is very misleading that you can write this :
SELECT * FROM orders WHERE date BETWEEN TO_DATE('2021-09-29 08:30:00',
'YYYY-MM-DD HH24:MI:SS') and TO_DATE('2021-09-30 08:30:37', 'YYYY-MM-DD
HH24:MI:SS');

This will ignore the time part and select rows that seem out of range.

TO_DATE function should reject the time part (HH24:MI:SS) in the template
string.

I just saw developers coming from Oracle spending a lot of time on this.

Thank you so much for working on this software.

B. R.

Sébastien Caunes

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-09-30 13:35:18 Re: Bug report function to_date should reject HH24:MI:SS formatting options
Previous Message PG Bug reporting form 2021-09-30 07:19:53 BUG #17205: pg_class.reltuples vakue wrong for brin indexes after vacuum (by many orders of magnitude)