I need to change the column type of a table
I'm using the following code:
ALTER TABLE cadastro_remetente ALTER COLUMN ssl_smtp DROP DEFAULT;
ALTER TABLE cadastro_remetente ALTER COLUMN ssl_smtp SET DEFAULT FALSE;
ALTER TABLE cadastro_remetente ALTER ssl_smtp TYPE bool USING CASE WHEN ssl_smtp='TRUE' THEN TRUE ELSE FALSE END;'
smtp is currently character varying
I'm returning the following error:
ERROR: check constraint "ssl_smtp" was violated by some registry
********** Error **********
ERROR: verification restriction "ssl_smtp" was violated by some registry SQL state: 23514
All logs are either TRUE or FALSE
Can anyone help me with this?