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 1kcKZO-0005wH-J3 for psycopg@arkaria.postgresql.org; Tue, 10 Nov 2020 03:43:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kcKZN-0006sq-H7 for psycopg@arkaria.postgresql.org; Tue, 10 Nov 2020 03:43:45 +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 1kcKZN-0006sj-9i for psycopg@lists.postgresql.org; Tue, 10 Nov 2020 03:43:45 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kcKZL-0003PK-71 for psycopg@lists.postgresql.org; Tue, 10 Nov 2020 03:43:44 +0000 Received: by mail-lf1-x131.google.com with SMTP id f11so9262549lfs.3 for ; Mon, 09 Nov 2020 19:43:42 -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=gkWNYg0qpQTU2l62S5dN4k15VMlQ3xkbJq5+Y0zsn54=; b=GSDYAYOT9U6jZAkKESJeE+Qbv+/74YH9oOGoErAY9/+BsNDHGaNCaxDUqkWH6pc/uA Y+AKnQoBD7hViwC+gyGhdQMVqr8emjUOztjcNPVpkX8WEfdL52FZWESC3sNZlEgi+KQp ou8H+awv9nc69ur/0OiGVlDoPmrOZTBTtWUd6AfnxInSybQrrAnxJkVhwEdf+tHxuM8K FhdbzzyAwDZDjsBDwSCE74UCO1+tzo+lW/Z9sLFWGl5pQ7BlKkfF/uDCCfklt9TO+6+A 8y/7pPK6fvKCPLPNHas4YC5SzN9L31HohdpU9mlJAUzUVx0FyB+0QnrCdgoC2UCfH8XH dwWA== 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=gkWNYg0qpQTU2l62S5dN4k15VMlQ3xkbJq5+Y0zsn54=; b=SHOi3hs9463agw7g8M07MtRUuvRG6uDQQUJRXzPrua81ct7rkBltWMxAml+c6+B+Ph O8mdtThfsF4SK0+ojPlMpvOEESitDKWjv6xyw4asF+eIEi8mxEy6oZTuQfpiCkvuhor/ 5HtgYSfvN3sNfJmXIk/45eXQ3NcJU1tJ8VagfGaLyf1t5nkzotRfyFz5gZNlBXu7aBl9 pcmF3WVOfBSeSQ7wpnUe6RM0pBd5JjfkuO8spl+mtIdcAjcKvHIHCpeiZvKbI2x9OSWr 5LILfyyy7i9ARTNosPvNCI1X2IkwYTqCUFfXVk7P5Fb3qSk/ZcNHkTMevT9spNrwLSj1 sqHA== X-Gm-Message-State: AOAM530dxO64G7rnT1hJ1lrY+iJXzpxuak/edDF1YpLcyiFDXDP9qjGi sS+XR4eeDrAe5zFvAUqhy7b4sIfy/VJ3uEw/CmY= X-Google-Smtp-Source: ABdhPJy4Bg95KsRM7VA5pagI5DUk15oGpPXq6EEKvWg16OeKzZZnRnu7/HGixYf33ncn4bVHwF8oPobo0q5mv5j7IXg= X-Received: by 2002:a19:2489:: with SMTP id k131mr5118528lfk.459.1604979820491; Mon, 09 Nov 2020 19:43:40 -0800 (PST) MIME-Version: 1.0 References: <2b9859f0-0964-2baa-b6bc-13f975ae0f67@aklaver.com> <88fb7a7e-a182-a816-c1a7-8a1f54b65215@aklaver.com> <4830fb8d-fa57-e0f8-0e4f-a96ed040dede@dndg.it> <1546497c-ff41-9bd0-b4d7-931bd305caac@dndg.it> <9989BCEF-2CC4-4AA4-9E4E-C83740F21414@thebuild.com> In-Reply-To: <9989BCEF-2CC4-4AA4-9E4E-C83740F21414@thebuild.com> From: Daniele Varrazzo Date: Tue, 10 Nov 2020 03:43:29 +0000 Message-ID: Subject: Re: psycopg3 and adaptation choices To: Christophe Pettus Cc: Vladimir Ryabtsev , Federico Di Gregorio , psycopg@lists.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:22, Christophe Pettus wrote: > > > On Nov 9, 2020, at 19:20, Daniele Varrazzo wrote: > > > > Choices to cast Python ``int`` type: > > Is it absurd to make the choice at execution time, based on the actual value of the Python int? I've been thinking a lot about it. I haven't completely ruled it out, but there are a few cases in which having different oids for the same query gets in the way. One that comes to mind is with prepared statements, either explicit (which I haven't exposed yet, but it's like the #1 request for a new feature), or implicit (currently using them to implement 'executemany()'). However I might be overestimating these issues, yes. I guess I should give an overview of the whole adaptation system: I'll try and write its documentation in the next few days. I have to start with the documentation somewhere... -- Daniele