On Tue, 10 Nov 2020 at 03:20, Christophe Pettus <[email protected]> wrote: > > I don't want to derail this, but a question: Can a connection be set to use > the simple-query protocol instead of the extended-query protocol in 3?
It won't be set explicitly to use simple/extended protocol, but if a query is passed with no parameter (because it just has no variable part, or because it's being composed client-side using functionalities similar to psycopg2.sql) then the simple-query protocol is used [1]. This is mostly useful to pass several queries at once, because the extended query protocol doesn't allow more than one query at time [2]. [1] https://github.com/psycopg/psycopg3/blob/bc02ae1c9c42892966ff079250c24ff5eae28b48/psycopg3/psycopg3/cursor.py#L243-L254 [2] https://www.postgresql.org/docs/current/libpq-exec.html#LIBPQ-PQEXECPARAMS -- Daniele
