Why does PostgreSQL accept junk when parsing an INTERVAL psql (11.8)
Type &quot;help&quot; for help.

public=# select '!@#$%^&amp;*()00:00:00.01&lt;&gt;?&lt;&gt;:'::interval;
  interval
-------------
 00:00:00.01
(1 row)

Seems to take just about anything... I don't see anything in the docs about this...
It's kind of cool but also worrisome... can I rely on say '__00:00:00.01__' ALWAYS working?
And what are the REAL rules - the ones in the docs are not complete apparently...
The documentation is the (open source) implementation of ParseDateTime in src/backend/utils/adt/datetime.c, which is used to parse all datetime data types. Essentially, this is not documented, but &quot;working as implemented&quot;.
As to &quot;why&quot;, you'd have to trawl the commit log and the related discussions on -hackers, but since some of that code is old enough to vote, this might prove difficult.
Perhaps the best answer is that the datetime parsing function is deliberately lax to allow various input formats.