且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Python和Psycopg2将JSON数据文件导入PostgreSQL

更新时间:2022-04-30 10:04:42

使用此:

cur.executemany("INSERT INTO test4 VALUES ('{0}')".format(readAll))

(readAll,): cur.executemany("INSERT INTO test4 VALUES (%s)", (readAll,))

请参阅: http://initd.org /psycopg/docs/usage.html#passing-parameters-to-sql-queries