반응형
import psycopg2 as pg2
from psycopg2.extras import DictCursor
conn = pg2.connect()
cursor = conn.cursor(cursor_factory=DictCursor)
cursor.execute('select %s, %s', ('test', 2))
cursor.query
"select E'test', 2"
반응형
import psycopg2 as pg2
from psycopg2.extras import DictCursor
conn = pg2.connect()
cursor = conn.cursor(cursor_factory=DictCursor)
cursor.execute('select %s, %s', ('test', 2))
cursor.query
"select E'test', 2"