UPDATE table_name SET col_name = varchar WHERE col_name 为 NULL;

UPDATE table_name SET col_name = varchar WHERE col_name is NULL;

以下更新失败:-

UPDATE table_name SET col_name = varchar WHERE col_name is NULL;

失败消息是:-

ERROR:  column "varchar" does not exist

而下面提到的成功了:-

UPDATE table_name SET col_name = 889977 WHERE col_name is NULL;

我检查了列的 pg_typeof - col_name 是 character varying。请帮忙。

我想你错过了字符串的引用

UPDATE table_name SET col_name = 'varchar' WHERE col_name is NULL;