public inbox for [email protected]  
help / color / mirror / Atom feed
From: Daniele Varrazzo <[email protected]>
To: Christophe Pettus <[email protected]>
Cc: [email protected]
Subject: Re: psycopg3 and adaptation choices
Date: Tue, 10 Nov 2020 03:30:47 +0000
Message-ID: <CA+mi_8adFSjjE6hHrccKzt7YWKmB4PybtRLOp2k_ms9YD0v6SA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CA+mi_8Zdk_beGcbOjkpdo+fchTR5ot1XM2zZc=ujSGqP+WVh-g@mail.gmail.com>
	<[email protected]>

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/...
[2] https://www.postgresql.org/docs/current/libpq-exec.html#LIBPQ-PQEXECPARAMS

-- Daniele





view thread (23+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: psycopg3 and adaptation choices
  In-Reply-To: <CA+mi_8adFSjjE6hHrccKzt7YWKmB4PybtRLOp2k_ms9YD0v6SA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox