default for column “xxxx” cannot be cast automatically to type boolean in Postgres DB

You have to drop the default constraint before changing the type:

ALTER TABLE parts 
    ALTER COLUMN is_dpm_scanned DROP DEFAULT,
    ALTER COLUMN is_dpm_scanned TYPE BOOLEAN USING is_dpm_scanned::BOOLEAN,
    ALTER COLUMN is_dpm_scanned SET DEFAULT FALSE;

See also:

  • Changing a column from string to string array in PostgreSQL for a detailed explanation.
  • How to cast varchar to boolean.

Leave a Comment

bahis casinocanlı casino siteleritürkçe altyazılı pornocanlı bahis casino