title: Query on partitioned table on PostgreSQL
body: <p>I have a table partitioned by year.
  With this query :</p>
  
  <pre><code>select *
  from myTable
  where year between '2018' and '2020'
  </code></pre>
  
  <p>the query plan is good, only 2018,2019,2020 partitions are used.</p>
  
  <p>But with this query </p>
  
  <pre><code>select *
  from myTable
  where year between '2018' and extract(year from now())::text
  </code></pre>
  
  <p>the partitions 2021 and 2022 appears in the query plan, why ?</p>