The module contains objects and functions useful to generate SQL dynamically, in a convenient and safe way. SQL identifiers (e.g. names of tables and fields) cannot be passed to the execute() method like query arguments: # This will not work table_name = 'my_table' cur.execute("insert into %s values (%s, %s)", [table_name, 10, 20])