Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcKNd-0005YM-HG for psycopg@arkaria.postgresql.org; Tue, 10 Nov 2020 03:31:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kcKN5-0001Nu-Ma for psycopg@arkaria.postgresql.org; Tue, 10 Nov 2020 03:31:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcKN5-0001Nn-Hf for psycopg@lists.postgresql.org; Tue, 10 Nov 2020 03:31:03 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kcKN3-0003JY-Bq for psycopg@postgresql.org; Tue, 10 Nov 2020 03:31:02 +0000 Received: by mail-lj1-x231.google.com with SMTP id q19so11292328ljc.10 for ; Mon, 09 Nov 2020 19:31:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HOeIL97WzFys6saDTxFUP1mSCTD6z4QxjorjOyLQKqg=; b=BYVtWlK+ynotGqXlh7jcQo668bUG5q1opawL1gVtWyW/HZ8sZng9DSmMPgFdobNeUr IZFXZE3jLGrJiDeZyh7s+nuXmz9YDGo3/rRwpgjhIDKQJkhQ3ugyxH0EmuCfBevyj5LV CnPXwMj0E7Z5E0PDQSp4boLzvwKqlNVyXvE2XsCa6Chi5YcnEWmb+dbJQ/MGhGoaHef3 4MfkQmIkYoX2CpaEfovdDnTz3WjbFk9XogKRMZzPl3y5ow6JQamAAZ+Gl6EYcMxxDznY ACL/QEIa8hOJUMFeM3sKrCOrRbx5HhGrGtYhCO4Vzqpb/riRiCAE5ohywCgSB/C9D+qO GyUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HOeIL97WzFys6saDTxFUP1mSCTD6z4QxjorjOyLQKqg=; b=n9G2KSt+KxhUvmTueVoMCgPvjWUwfXr7NJgE9oiJ2iKrT97rDj58oTH7bh5yo6dCfx rFlZ6LC67eFLdaFWsPuk1dHg4xTMX6uOPLujZjFLtrZ1cXx5lM5l1bdd1KpeO/q5h7lE 6DeH0zpiJWQMxQWgqQtwQv5bFgCwoINnuIHtduXKOqQlOHqgThV4IErtCdjHtU0Zn3Jh UhoCUFg+o/d+EP4XPL0ivt9M8B7fiX256KICQdRAzGf6WlgcSwxTBEjp20TeIychercH mC/m8NDsygZmb1YHSPi0frp1E7SMGNOWhYNgUt+t1QgujBcHdDMm8I5ySRUpOXflYfjU MMBA== X-Gm-Message-State: AOAM533/JzDikRyA0EutDV8ZP96274xjgR5z6asS5NQ3vK3DIiIH6pnn kfx6LDpfQ4bsfgoPbhYJqZfg1tFmM41CgHez3VI= X-Google-Smtp-Source: ABdhPJxrY0b+5P0gpqFwsjj9iExwtwGhurzfP68T51W05a3i6LMASu9G7x3u49xclx00NXH93Se4lP+1OJDRklgchq4= X-Received: by 2002:a2e:808a:: with SMTP id i10mr7003569ljg.427.1604979059385; Mon, 09 Nov 2020 19:30:59 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Daniele Varrazzo Date: Tue, 10 Nov 2020 03:30:47 +0000 Message-ID: Subject: Re: psycopg3 and adaptation choices To: Christophe Pettus Cc: psycopg@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 10 Nov 2020 at 03:20, Christophe Pettus 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