diff --git a/psycopg2cffi/_impl/adapters.py b/psycopg2cffi/_impl/adapters.py index 108a7da..20e91cf 100644 --- a/psycopg2cffi/_impl/adapters.py +++ b/psycopg2cffi/_impl/adapters.py @@ -289,7 +289,10 @@ def _getquoted(param, conn): """Helper method""" if param is None: return b'NULL' - adapter = adapt(param) + if isinstance(param, _BaseAdapter): + adapter = param + else: + adapter = adapt(param) try: adapter.prepare(conn) except AttributeError: