Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uvtA1-003BtB-66 for psycopg@arkaria.postgresql.org; Tue, 09 Sep 2025 07:53:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uvtA0-00AbUZ-4R for psycopg@arkaria.postgresql.org; Tue, 09 Sep 2025 07:53:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uvt9z-00AbUQ-Sq for psycopg@lists.postgresql.org; Tue, 09 Sep 2025 07:53:04 +0000 Received: from mail-yx1-xb130.google.com ([2607:f8b0:4864:20::b130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uvt9w-001LfT-26 for psycopg@postgresql.org; Tue, 09 Sep 2025 07:53:04 +0000 Received: by mail-yx1-xb130.google.com with SMTP id 956f58d0204a3-5fe42994547so1068706d50.0 for ; Tue, 09 Sep 2025 00:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757404379; x=1758009179; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=1weA0xz9d2LNp0Ba6Bf2rBjL9/Mu5xjdWWkU5fifKJI=; b=h9c8XUllJ5PEFhlS9ZR1v7fIcQ+HYOgwUKQVZsgssaxx0VArnfol3RTy3EukxZUm0r DuqlAHleVjxzeGrVsiDFOgzRnikcE6huvhVfDK2ZKn81VggEH9YD19rdk0poUIOEm/Rt nblEQA1wbwM3NGiE+JjX6b4DVKEP1nXuDLXd5CccVreEQBfmRrY1W6U5U5wzKxjBvfof bArd5XOnOFPWTG3cAhX/Gw4/xclHc3XOwjdBdh9bXwC6a+5yigt/3shUUr/j5trjmNRI 81y4SUnroIIzAUG87SiNMW6JZzbVwa7IrnwGJAzUzK7trdS6g+AKvG5UwPjSkmwpo6Bx wwCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757404379; x=1758009179; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=1weA0xz9d2LNp0Ba6Bf2rBjL9/Mu5xjdWWkU5fifKJI=; b=kmAyyRD6GktQ2qUPOwqNEwe2OnCVs2+MEolOmiv2LcjWSchjVvI4jvrEvrh8+9IoEf E3zKk3VrPJu8pr56LiRviM+YGC9AiiSB4qJmC0CB4r5ODHN4gQekOydgaah3vLpYSfud GQc3cUELQUdAfXNHbyJVqHiX5SnwOtp7censhpGQgtgULMOzuB1GtJ1M66nQoqtp6Dpt W9o4Q1plsBurljTWPZ92x5+jnXvxYix0gWWdvj0/g4jBnFXixMWxquqCWqe/uTCJeQpM KlFuq4CXbI8H63mCUwGLGml1+rzb64+d6sO6pW2IotPWqrlp9ihAhW4NkqCM5V8g9iAW LdTQ== X-Gm-Message-State: AOJu0YzONPLCU3TOShybt/b8yzao/ZTQ1Vchi8z5kEAPG59fgKdXS2db vfudlC4oyLvXBSGd4cXBFCZrj5hJ9EAD4Bo1d8w1wwm+0GtmhhkQQf4WkBKIDm6dzc7gj0BJ+Fb 8qWm22JXz3BWl8S676Di/B/qArxuG9wQw3Pty X-Gm-Gg: ASbGnctqC3vLys3JilR1Rz5ZHOwz1eXjkyBdm79p3WlXZTiWB3bTzRuKVvisqFVIJPD R7cMHN3oKFZ4amJ9QaJOAM+Ew7A0S7ZUd8spd9psoZQI2/1L/KESO5R4HXlZr2ymrDxjVtVjwMa ptltRGh2pZELXN0zr5xHFN3sQHoA9EUFk0iWKNTLBAMcRzrWKMbDAjlHT8YTneQl0/+eJhkeZH9 nZjUjf3 X-Google-Smtp-Source: AGHT+IHIRrzoYM8wk7lddL8uNsBOtGp4ySWQAz166mtlAsgXeVeqqROPnynNvjjxa+ntV/dmsTJwMMVU5E0xeykWqqw= X-Received: by 2002:a05:690c:490a:b0:71f:b944:103f with SMTP id 00721157ae682-727f5541763mr106255957b3.48.1757404379249; Tue, 09 Sep 2025 00:52:59 -0700 (PDT) MIME-Version: 1.0 From: Daniele Varrazzo Date: Tue, 9 Sep 2025 09:52:47 +0200 X-Gm-Features: Ac12FXws2COFHmPCdgSBzMfd1KYiXqI042ZGS8I0xpJiLiF75DrQiNWY5iah74M Message-ID: Subject: Psycopg 3.3.0.dev1 released - with Template Strings support! To: Psycopg Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, I have released a preview version of Psycopg 3.3.0 on test pypi. You can install it using: pip install -i https://test.pypi.org/simple/ "psycopg[binary]==3.3.0.dev1" This version allows writing queries as template strings, a new language feature released with Python 3.14. The use of t-string in Psycopg is documented at . Template strings allow to express parametrized queries using the same syntax of f-strings, but allowing Psycopg to manage the arguments, either for server-side or for client-side binding - easily both at the same time. For example a query like the following will have the table name merged on the client and the id parameter sent separately, eventually even after the statement is prepared internally: cursor.execute(t"SELECT * FROM {table_name:i} WHERE id = {id}") Using t-strings eliminates the need to keep lists of query placeholders and parameters in sync, making queries easier to read and to maintain. I am really excited about this new language feature and I hope that the support we designed for Psycopg will make the most of it! Therefore we are releasing preview packages to allow wider testing and gather feedback before a final 3.3 release. Feedback is very welcome. Happy hacking! -- Daniele