当我将SQL查询插入到PostgreSQL中时,我收到了来自psycopg2的以下错误,但我不确定我要去哪里哪里
错误消息:
testing-01% sudo python3 ./tables.py
Traceback (most recent call last):
File "./tables.py", line 18, in add_cols
cursor.execute("INSERT INTO "+table_name+" (Fieldtest1, Fieldtest2, Fieldtest3, Fieldtest4, Fieldtest5, Fieldtest6) VALUES ('Row6', 'Row6', 'Row6', 'Row6', 'Row6', 'Row6');")
psycopg2.ProgrammingError: column "fieldtest1" of relation "test" does not exist
LINE 1: INSERT INTO test (Fieldtest1, Fieldtest2, Fieldtest3, Fieldt...
正在执行的table.py中的查询语句:
cursor.execute("INSERT INTO testname (Fieldtest1, Fieldtest2, Fieldtest3, Fieldtest4, Fieldtest5, Fieldtest6) VALUES ('Row6', 'Row6', 'Row6', 'Row6', 'Row6', 'Row6'));
我正在使用的数据库中已经设置了列名。想法?