使用psychopg2更新PostgreSQL中包含值列表的列的行

时间:2018-03-29 11:35:40

标签: postgresql psycopg2

我有一个带有列噪声的表环境,我需要更新噪声列中的所有行,并带有值列表,new_dB_values_list和len(new_dB_values_list)= no。的行。 我的代码是这样的:

PsqlCon = psycopg2.connect(host="xx.xxx.xxx.xx", dbname='all_green', user='xxxx' , password='yzzxxx')
con = PsqlCon.cursor()
con.execute("""UPDATE environment SET noise new_dB_values_list;""")

我做错了什么,正确的方法是什么。感谢。

获取错误:

ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.

Traceback (most recent call last):
psycopg2.ProgrammingError: syntax error at or near "new_dB_values_list"
LINE 1: UPDATE environment SET noise new_dB_values_list;
                                     ^

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
AttributeError: 'ProgrammingError' object has no attribute '_render_traceback_'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
AssertionError

0 个答案:

没有答案