title: Why does one of these very similar jsonpaths work, but not the other?
body: <p>Bumped into this while debugging a query from the ORM and have no idea why it happens. Asking mostly out of curiosity. In PostgreSQL 12.5 the following occurs:</p>
  <pre class="lang-sql prettyprint-override"><code>-- All good:
  select ('$[*] ? (@.live_at &lt;= 2020-11-18)')::jsonpath
  
  jsonpath                               |
  ---------------------------------------|
  $[*]?(@.&quot;live_at&quot; &lt;= (2020 - 11) - 18) |
  
  -- But then:
  select ('$[*] ? (@.live_at &lt;= 2020-05-18)')::jsonpath
  
  SQL Error [42601]: ERROR: syntax error, unexpected IDENT_P at end of jsonpath input
    Position: 9
    SQL Error [42601]: ERROR: syntax error, unexpected IDENT_P at end of jsonpath input
    Position: 9
      SQL Error [42601]: ERROR: syntax error, unexpected IDENT_P at end of jsonpath input
    Position: 9
        SQL Error [42601]: ERROR: syntax error, unexpected IDENT_P at end of jsonpath input
    Position: 9
          ERROR: syntax error, unexpected IDENT_P at end of jsonpath input
    Position: 9
          ERROR: syntax error, unexpected IDENT_P at end of jsonpath input
    Position: 9
  </code></pre>
  <p>I've a suspicion that this is related to octal representation, but node seems to eat <code>2020-05-18</code> just fine. What gives?</p>