Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql Postgres:将varchar转换为文本_Postgresql_Text_Varchar - Fatal编程技术网

Postgresql Postgres:将varchar转换为文本

Postgresql Postgres:将varchar转换为文本,postgresql,text,varchar,Postgresql,Text,Varchar,我搞砸了,创建了一个列作为varchar(255),这已经不够了。我读到varchar与Postgres上的文本相比没有性能优势,因此希望以安全的方式将varchar转换为文本列,以保留数据 对我来说最好的方法是什么 ALTER TABLE table1 ALTER COLUMN column1 TYPE text;

我搞砸了,创建了一个列作为varchar(255),这已经不够了。我读到varchar与Postgres上的文本相比没有性能优势,因此希望以安全的方式将varchar转换为文本列,以保留数据

对我来说最好的方法是什么

ALTER TABLE table1 ALTER COLUMN column1 TYPE text;