Postgres: Convert varchar to text

PostgresqlTextVarchar

Postgresql Problem Overview


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?

Postgresql Solutions


Solution 1 - Postgresql

ALTER TABLE table1 ALTER COLUMN column1 TYPE text;

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionWilliam JonesView Question on Stackoverflow
Solution 1 - PostgresqlrfuscaView Answer on Stackoverflow