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 1khvtM-00068q-JH for psycopg@arkaria.postgresql.org; Wed, 25 Nov 2020 14:35:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1khvtL-0004uI-Hh for psycopg@arkaria.postgresql.org; Wed, 25 Nov 2020 14:35:31 +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 1khvtK-0004u6-6i for psycopg@lists.postgresql.org; Wed, 25 Nov 2020 14:35:31 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khvtF-00057D-S2 for psycopg@postgresql.org; Wed, 25 Nov 2020 14:35:29 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 19D68746; Wed, 25 Nov 2020 09:35:24 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 25 Nov 2020 09:35:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=O KpbRRsGILEo0Pg82MzaU3Y0D6yGUz6lcUJfRkYiZvU=; b=lWeaaYGBViggMsfLX ICTJcn1JFJffZvs2Ypo3R0RJBrOREyAZca18Mf56G7LuUAAMP2q9stcjd9V1WoaK 8es7hfR0fXAElwAeVt4EG6H7eB3Au3yfG05ELm88HM7lgxzRBxQye6jA8pvzGrZu QuyF9P26e6dvaNLttaNDzO6kud4l4oQ5G3gUZMvqs0nc9khqIr3g06TY4tZTlnyj if88GuJjg3Rd+XADoNMajqmwkgzBr0WTWNiLbtTdWBEy8k+odVEoX7zuQVBMiEKw H+GgWqSO/XOQvdymRtJwDiI9BR9IkskaP3+SkRvgDmp5X/zEFRuLRvPWQBE9Krlj XhEGw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=OKpbRRsGILEo0Pg82MzaU3Y0D6yGUz6lcUJfRkYiZ vU=; b=DUrHzINGtgjgCZZEWiFBmnWJXq6rd73pIV6G6VkeaR/B29xFQFi9ftRiC z6HL08RXYg0OlyWQ5OFEQE4wRZLrMiAkuF9ufJ5d2dAiD7xMzjvFFWJFzKGNm+yj 1rdcLJ7J2IgC1yJ1U5w/Q2WIxkz6Cmpj10c4BDgT1hA0KQJoicLgMJN1AZ7TDhrF NV4KECYC+Ajo7XcgTbHkh4MEQW9DVw7TPMEReDH5oaA8ne0bPyAsMJ9dtj1zBH97 nMPZWH+SrJUnNDJ7uXIvemZafz6LQSWWVG0Pkk/A7xjAyf04sm05027GvGd6EzYO a9Uz86dMyw+Tay4FmaCCbqi34lqBw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudehtddgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeejhfeftddugfdvjeekkeelveefhefgfeeuieeugedv ffeijefgueffvdefleduvdenucffohhmrghinhepphhshigtohhpghdrohhrghenucfkph epjeehrddujedvrdduledrudefleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hm X-ME-Proxy: Received: from [192.168.1.4] (75-172-19-139.tukw.qwest.net [75.172.19.139]) by mail.messagingengine.com (Postfix) with ESMTPA id 565423064AB3; Wed, 25 Nov 2020 09:35:22 -0500 (EST) Subject: Re: Adaptation in psycopg3 To: listas , Daniele Varrazzo , psycopg@postgresql.org References: <7ec5da30-9d28-2bab-7eaa-7038711a99f0@soft-com.es> From: Adrian Klaver Message-ID: <7d110c22-f645-0dc4-1d98-3f8c40604c9e@aklaver.com> Date: Wed, 25 Nov 2020 06:35:21 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <7ec5da30-9d28-2bab-7eaa-7038711a99f0@soft-com.es> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/25/20 4:29 AM, listas wrote: > El 24/11/20 a las 17:52, Daniele Varrazzo escribió: >> Hello, >> >> I wrote a description of the psycopg3 adaptation system and the main >> differences compared to psycopg2: available at >> https://www.psycopg.org/articles/2020/11/24/psycopg3-adaptation/ >> >> Initial API docs are available at >> https://www.psycopg.org/psycopg3/docs/adaptation.html >> >> Feedback is welcome. Cheers! >> >> -- Daniele >> > > Hi Daniele, thanks for your effort. > > After reading the docs i have a question about the parameters in the > 'in' clause. > > In psycopg2 i do: > >  params = (1,2,3,4) >  cursor.execute("select * from mytable where field1 in %s", (params,)) > > or > >  params = ('black','red','green') >  cursor.execute("select * from mytable where field2 in %s", (params,)) > > What will it be like in psycopg3, will it be the same?, will I have to > create a special adapter? From the link: "cannot use the IN (...) construct: # Must use "AND nation = any (%s)" cur.execute("... AND nation in %s", [("IT", "FR", "DE")]) " > > Thanks > -- > Oswaldo Hernández > > -- Adrian Klaver adrian.klaver@aklaver.com