Increasing the size of character varying type in postgres without data loss

后端 未结 6 2075
春和景丽
春和景丽 2021-02-06 20:54

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_deta         


        
6条回答
  •  隐瞒了意图╮
    2021-02-06 21:22

    Changing the Column Size in Postgresql 9.1 version

    During the Column chainging the varchar size to higher values, table re write is required during this lock will be held on table and user table not able access till table re-write is done.

    Table Name :- userdata Column Name:- acc_no

    ALTER TABLE userdata ALTER COLUMN acc_no TYPE varchar(250);

提交回复
热议问题