title: PG::InvalidDatetimeFormat: ERROR: invalid input syntax for type date: “”
body: <p>Database postgresql</p>
  
  <p>I have following migration:</p>
  
  <pre><code>class AlterBirthdayInUsers &lt; ActiveRecord::Migration[5.0]
    def change
      change_column :users, :birthday, 'date USING CAST(birthday AS date)', default: Date.today
    end
  end
  </code></pre>
  
  <p>Migration is started an error:</p>
  
  <pre><code>rake stdout: == 20170201162913 AlterBirthdayInUsers: migrating =======================
  -- change_column(:users, :birthday, "date USING CAST(birthday AS date)", {:default=&gt;Sat, 18 Feb 2017})
  rake stderr: rake aborted!
  StandardError: An error has occurred, this and all later migrations canceled:
  
  PG::InvalidDatetimeFormat: ERROR:  invalid input syntax for type date: ""
  : ALTER TABLE "users" ALTER COLUMN "birthday" TYPE date USING CAST(birthday AS date)
  </code></pre>
  
  <p>How correct point for postgrees in the migration field of type date? </p>
  
  <p>Thanks in advance for your reply.</p>