title: PostgreSQL create index on cast from string to date
body: <p>I'm trying to create an index on the cast of a varchar column to date. I'm doing something like this:</p>
  
  <pre><code>CREATE INDEX date_index ON table_name (CAST(varchar_column AS DATE));
  </code></pre>
  
  <p>I'm getting the error: <code>functions in index expression must be marked IMMUTABLE</code> But I don't get why, the cast to date doesn't depends on the timezone or something like that (which makes a cast to timestamp with time zone give this error).</p>
  
  <p>Any help?</p>