我启动了一个名为GREEN.db的新数据库,其中一个表定义如下:
CREATE TABLE articles(
"articleID" serial NOT NULL,
"articleTitle" character varying(21) NOT NULL,
"articleContent" text NOT NULL,
"articleAuthor" character varying(7) NOT NULL ,
"articleTime" timestamp without time zone DEFAULT now(),
CONSTRAINT articles_pkey PRIMARY KEY ("articleID")
)我的代码如下:
db = web.database(dbn='postgres', db='green',user='YOng',password='xxx')
......
i = web.input()
t = time.localtime(time.time())
st = time.strftime("%Y-%m-%d %H:%M:%S", t)
datas = list(db.query("""SELECT * FROM articles ORDER BY "articleID" DESC"""))
n = db.insert("articles",
articleID=len(datas)+1, \
articleTitle=i.post_title, \
articleContent=i.post_content, \
articleAuthor="YOng", \
articleTime=st)
web.seeother('/')这一错误被抛出,说:
程序错误:关系“条款”的列“条款”不存在第1行:插入文章(articleTitle,articleAuthor,articleID)^
我不知道这密码怎么了。有人有什么建议吗?任何帮助都要感谢~
发布于 2013-11-06 07:44:34
也许是因为大写字母?
错误是:
column "articleid" of relation "articles" does not exist您的列名是"articleID“
https://stackoverflow.com/questions/16684893
复制相似问题