I have a python list cve_id
, pkg_name
& vuln_status
. I'd like to import the data from these lists int a postgresql table
What I have tried:
from scanner import *
import psycopg2
try:
conn = psycopg2.connect(database="test", user="postgres",password="something", host="127.0.0.1", port="5432")
except:
print "Database un-successfull"
quit()
cur = conn.cursor()
cur.execute("INSERT into vuln_data(cve_id, pkg_name, status) VALUES (%s,%s, %s)", (cve_id, pkg_name, vuln_status))
conn.commit()
conn.close()
I get an error saying
psycopg2.DataError: multidimensional arrays must have array expressions with matching dimensions
^
Would love if someone could point out what can be done, here.
Thanks