1
1
mirror of https://github.com/psycopg/psycopg2.git synced 2025-02-25 05:00:32 +03:00

docs: fixed quote_ident() example

Close 
This commit is contained in:
Daniele Varrazzo 2022-07-27 02:54:17 +02:00
parent 3c58e96e10
commit 611c610041

View File

@ -33,7 +33,7 @@ name should be escaped using `~psycopg2.extensions.quote_ident()`::
# This works, but it is not optimal
table_name = 'my_table'
cur.execute(
"insert into %s values (%%s, %%s)" % ext.quote_ident(table_name),
"insert into %s values (%%s, %%s)" % ext.quote_ident(table_name, cur),
[10, 20])
This is now safe, but it somewhat ad-hoc. In case, for some reason, it is