Postgres: remove check constraint on varchar column

11.8k Views Asked by At

I'm coming from a MySQL world and am having a hard time doing things in PostgreSQL.

I have a column which looks like this in my GUI client: enum column

I'm not sure if it is an enum column, or a varchar with a constraint (are they the same thing in postgres?)

I want to change the type of the column to a varchar/string. I've tried this:

ALTER TABLE tablename ALTER COLUMN type TYPE character varying(255);

but no luck, I still see the constraints on the column

1

There are 1 best solutions below

3
On BEST ANSWER

I was able to solve this issue with some guidance from @mich4ael's helpful comment

ALTER TABLE tablename DROP CONSTRAINT constraint_name;