问题
The following UPDATE fails :-
UPDATE table_name SET col_name = varchar WHERE col_name is NULL;
The failure message is :-
ERROR: column "varchar" does not exist
Whereas the undermentioned one succeeds :-
UPDATE table_name SET col_name = 889977 WHERE col_name is NULL;
I have checked the pg_typeof
of the column - col_name is character varying
. Kindly help.
回答1:
i think you missed quote for string
UPDATE table_name SET col_name = 'varchar' WHERE col_name is NULL;
来源:https://stackoverflow.com/questions/55677689/update-table-name-set-col-name-varchar-where-col-name-is-null