findepi commented on issue #7249:
URL: https://github.com/apache/datafusion/issues/7249#issuecomment-2452989590

   > Postgres supports an optional precision specifier in timestamp literals 
(e.g. `timestamp (3) '2021-01-01 00:00:00.123'` .
   
   I don't think this should be necessary. 
   From literal precision inference perspective, TIMESTAMP literals are not 
different from DECIMAL or varchar. The literal's precision should be reflected 
in the literal's type.
   `TIMESTAMP  '2021-01-01 00:00:00.123'` clearly has millisecond precision. 
requiring user to add `(3)` part is redundant.
   if a user wants the literal to be parsed with specific precision, they can 
use `CAST('2021-01-01 00:00:00.123' AS timestamp(p))` or shorter `'2021-01-01 
00:00:00.123'::timestamp(p)`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to