Skip to content

Instantly share code, notes, and snippets.

@ganapathichidambaram
Last active November 11, 2019 09:08
Show Gist options
  • Save ganapathichidambaram/14dd8d650cf3d23816a9fc4a65dba879 to your computer and use it in GitHub Desktop.
Save ganapathichidambaram/14dd8d650cf3d23816a9fc4a65dba879 to your computer and use it in GitHub Desktop.
Alter Postgresql table column to varchar from integer or other datatype
-- SQL : PostgreSQL
-- tablename - Name of the table which we want to alter the column
-- columnname - Name of the columnn which we want to change to varchar from other datatype.
ALTER TABLE
tablename
ALTER COLUMN
columnname type varchar using columnname::varchar;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment