Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBLgF-0007nX-3d for pgsql-general@arkaria.postgresql.org; Wed, 25 Apr 2018 14:45:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fBLgD-0002TJ-Nq for pgsql-general@arkaria.postgresql.org; Wed, 25 Apr 2018 14:45:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBLgD-0002T9-G8 for pgsql-general@lists.postgresql.org; Wed, 25 Apr 2018 14:45:57 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBLg7-0006vC-Kw for pgsql-general@lists.postgresql.org; Wed, 25 Apr 2018 14:45:57 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A5E8321BAA; Wed, 25 Apr 2018 10:45:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 25 Apr 2018 10:45:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=NWIPznlOwb8+BNHPpZC819tM+2zD9 6ctOvetxphq5/w=; b=mPO+XTKMG480pb86leBmlcpCW0hnkOuEpZ2DcTwV7lYD0 FyaZxw0ahZ1LEt+xTTExIkRKdcL+qg6gyBF2KHF6XD6CXqdDrW4RlZvLTHPM/5WF 1gbc0W7YednJ1D1hTCho3zAi+tCOkcpfxqSjk0keHptMeJ45t0sJSDI4Vm8DyTcL UpCOwNLWv8fU5zWUG4znHTKkxalLW3Ufcdpr1+i5ketE4QnuyL6Bk6PM1Udtw0vJ xnPy+iGInU1ZHApAeN+S4z7Z1xjH5nvD1Y3AhXYCfPV5+8Ia2Q3OSIpc+uq+6vQM nBzMZc98AxVeIDWBC06YqZ9EKe8LFPYVAmvZw10kg== 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-sender:x-me-sender:x-sasl-enc; s=fm2; bh=NWIPzn lOwb8+BNHPpZC819tM+2zD96ctOvetxphq5/w=; b=PSa31j3FfICHt/A9z520Tp KH2i+tjixPLuHqq2/yRjiuRjDeJ09rJPY8JKWnApyfMjZJtN3Ppq2FQ7JlluecTs M8eqd9gvEt3w4qB5Lh+MHRhgt98xSUqrqRUKomvN5sBAy3C2rT+XVPUANn7urPVx 4FlBYrYF9jX26Oc+wzDDyt1CGNPRWFMj9oHplTQKpdE9CVT1N8UGFaS4pTZQOUOW aNQ4GHM4TeiTVmOEuq92r1VJ0clSdFEhXnBaCKbxrgiHRfkDIs7JO3p9l4aEMZ50 6Ct+QNziOtautnACIFw9GxbNGku4J8EfylhVX+J2drAvk8NS1WbF/c1SK7Z41aiw == X-ME-Sender: Received: from [192.168.1.2] (unknown [71.212.135.74]) by mail.messagingengine.com (Postfix) with ESMTPA id 12DBFE50A3; Wed, 25 Apr 2018 10:45:47 -0400 (EDT) Subject: Re: Inconsistent compilation error To: raf , pgsql-general@lists.postgresql.org References: <20180419010228.jcogqkeu2b7bxh2q@raf.org> <20180425123311.i6xfswa2kn2eaa7v@raf.org> From: Adrian Klaver Message-ID: Date: Wed, 25 Apr 2018 07:45:47 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180425123311.i6xfswa2kn2eaa7v@raf.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 04/25/2018 05:33 AM, raf wrote: > Adrian Klaver wrote: > >> On 04/18/2018 06:02 PM, raf@raf.org wrote: >> >> Hmm, wonder if there is an oops in the below: >> >> http://www.pygresql.org/contents/changelog.html >> >> Version 5.0 (2016-03-20) >> Changes in the DB-API 2 module (pgdb): >> "SQL commands are always handled as if they include parameters, i.e. literal >> percent signs must always be doubled. This consistent behavior is necessary >> for using pgdb with wrappers like SQLAlchemy." > > well spotted! but i'm not sure. it depends on what they mean by > "literal percent signs". that might just mean percent signs that > appear in SQL string literals that need to be output ultimately > as actual percent signs but i thought that they always had to be > doubled. so i'm not sure what they are saying has changed in > that version. so maybe you are right. > > but if they are suggesting that every single percent sign needs > to be doubled by the caller before passing sql to the pgdb > module, that sounds like an annoying change to have made. > but no doubt they have their reasons. > > i've encountered other new behaviour with pygresql-5+ that i had > to find ways to disable/revert so it's not surprising that there > might be other oddities to encounter. i'm surprised it's only > become a problem now. > > i think you're definitely right. when i change my function > loading program to duplicate all percent signs in all the source > code before passing it to pgdb, they all load successfully and a > subsequent audit of the code inside the database and on disk > still shows that they match, so pgdb must be de-duplicating all > the duplicated percent signs. You might want to raise this on the PyGreSQL mailing list: https://mail.vex.net/mailman/listinfo.cgi/pygresql and see what they have to say. > > thanks so much for spotting this. > > cheers, > raf > > > -- Adrian Klaver adrian.klaver@aklaver.com