I am trying to execute insert from Python on PostgreSQL using the pgdb module.
I see that the documentation says:
cursor.executemany(query, list of params)
So I'm trying things like:
>>> insert = "insert into foo (name, number) values (?,?);" >>> params = [{ 'name': 'John', 'number': 123 }, { 'name': 'Jack', 'number': 234 }] >>> cursor.executemany(insert, params)
Does this give me an error pointing to ? . What is the correct syntax for such a parameterized query? Also, if indicated in the documentation, where can I find it?
source share