perrosnk
perrosnk

Reputation: 935

How to alter Postgres column type from ENUM to VARCHAR

I have a column with type ENUM. The possible values are "public, private, followers".

How can I convert the column type to varchar without losing the values?

The postgres version is 9.6

Upvotes: 6

Views: 5331

Answers (1)

Oto Shavadze
Oto Shavadze

Reputation: 42853

Yes, you can

alter table table_name alter column col_name  TYPE varchar;

Upvotes: 12

Related Questions