You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
psycopg has a documentation section explaining why you cannot use %s for table names (quoting will cause syntax errors).
In aiopg examples, there is nothing that shows how this could be done.
I was able to run it by doing something like this:
from psycopg2 import sql
query = sql.SQL("select * from {}").format(sql.Identifier(table_name))
query = query.as_string(conn._connection._conn) # Use the wrapped psycopg connection
This works, but is there a less hacky way to achieve this? I could not find it in the documentation.
The text was updated successfully, but these errors were encountered:
psycopg
has a documentation section explaining why you cannot use%s
for table names (quoting will cause syntax errors).In aiopg examples, there is nothing that shows how this could be done.
I was able to run it by doing something like this:
This works, but is there a less
hacky
way to achieve this? I could not find it in the documentation.The text was updated successfully, but these errors were encountered: