PostgreSQL

How to increase the lenght of a character varying datatype in PostgreSQL without data loss

Written by Ian Carnaghan · 9 sec read >

Run the following command

alter table TABLE_NAME alter column COLUMN_NAME type character varying(120);

This will extend the character varying column field size to 120.

Remember to change TABLE_NAME to the relevant table name and COLUMN_NAME to the relevant column name.

Last Updated On April 07, 2018
Written by Ian Carnaghan
I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment. Profile

Leave a Reply

avatar
  Subscribe  
Notify of