【发布时间】:2018-09-01 08:03:22
【问题描述】:
sql="select %s,tablename from pg_table_def where tablename like (%s)"
data=("schemaname","abc",)
cur.execute(sql,data)
如果我如上所述传递一个值,则选择将其作为字符串。 这不是本意。
如果我尝试
data=(schemaname,"abc",)
然后它显示错误global name 'schemaname' is not defined。
【问题讨论】:
标签: python postgresql aws-lambda amazon-redshift psycopg2