I need to increase the size of a character varying(60) field in a postgres database table without data loss.
I have this command
alter table client_details alter column name set character varying(200);
will this command increase the the field size from 60 to 200 without data loss?
Referring to this documentation, there would be no data loss,
alter columnonly casts old data to new data so a cast between character data should be fine. But I don’t think your syntax is correct, see the documentation I mentioned earlier. I think you should be using this syntax :And as a note, wouldn’t it be easier to just create a table, populate it and test 🙂