繁体   English   中英

你如何更新postgres中的字段

[英]How do you update a field in postgres

我有一个名为 product.template 的表,我想在执行以下操作时将列 christian(字符变化)的值更改为 product:

UPDATE product_template SET christian = product;

我收到一条错误消息:

ERROR:  column "product" does not exist
LINE 1: UPDATE product_template SET christian = product
                                                ^

********** Error **********

ERROR: column "product" does not exist
SQL state: 42703
Character: 41

我究竟做错了什么?

由于您要更新列的值是一个字符串,因此您必须引用它,因此请尝试以下操作:

UPDATE product_template SET christian = 'product';

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM