93

I screwed up and created a column as a varchar(255) where that is no longer sufficient. I've read that varchar has no performance benefits over text on Postgres, and so would like to convert the varchar to a text column in a safe way that preserves the data.

What's the best way for me to do this?

William Jones
  • 18,089
  • 17
  • 63
  • 98

1 Answers1

154
ALTER TABLE table1 ALTER COLUMN column1 TYPE text;
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
rfusca
  • 7,435
  • 2
  • 30
  • 34