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 1jdXzR-00060b-W4 for psycopg@arkaria.postgresql.org; Tue, 26 May 2020 11:43:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jdXzQ-0007WK-Qq for psycopg@arkaria.postgresql.org; Tue, 26 May 2020 11:43:24 +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 1jdXzQ-0007WD-LT for psycopg@lists.postgresql.org; Tue, 26 May 2020 11:43:24 +0000 Received: from securemail-y56.synaq.com ([196.35.198.72]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jdXzN-0002cj-AP for psycopg@postgresql.org; Tue, 26 May 2020 11:43:23 +0000 Received: from [197.90.32.26] (helo=[192.168.0.8]) by securemail-pl-omx9.synaq.com with esmtpa (Exim 4.92.3) (envelope-from ) id 1jdXz6-000HI5-8D for psycopg@postgresql.org; Tue, 26 May 2020 13:43:04 +0200 To: psycopg@postgresql.org From: Frank Millman Subject: Minor issue Message-ID: <92a25cd6-5b50-3074-0da6-7394db9e0f0a@chagford.com> Date: Tue, 26 May 2020 13:42:56 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SYNAQ-Pinpoint-Information: Please contact SYNAQ for more information X-SYNAQ-Pinpoint-ID: 1jdXz6-000HI5-8D X-SYNAQ-Pinpoint: Found to be clean X-SYNAQ-Pinpoint-SpamCheck: not spam, SpamAssassin (not cached, score=-1.1, required 9, autolearn=disabled, ALL_TRUSTED -1.00, DCC_REPUT_13_19 -0.10) X-Pinpoint-From: frank@chagford.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi all This is very minor, but I thought I would mention it. I have a function that returns a complex SQL query and a tuple of parameters. The query is stored inside the function as a triple-quoted string, and the parameters are derived depending on the input arguments. Sometimes while testing I will comment out some of the SQL using '--'. If those lines happen to contain a parameter placeholder ('%s') I expected to remove the parameter from the tuple as well. pyodbc and sqlite3 both work this way, but psycopg2 raises the exception 'tuple index out of range'. I can live with it, but it means that I have to adjust the parameter tuple differently depending on which database I am testing with. If it can be fixed, that would be nice. If it can't, no problem. Frank Millman