How to increase the length of a character varying datatype in Postgres without data loss

1 Comment

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.

Image Credits: Photo by Isis França on Unsplash.

Related Articles

No results found.

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
naspy Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
naspy
Guest
naspy

An example would have been really appreciated.

This did’nt bring enough information, because my query still doesn’t work

Menu