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 1f910o-0003ks-S1 for pgsql-general@arkaria.postgresql.org; Thu, 19 Apr 2018 04:17:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f910l-0006uh-Hg for pgsql-general@arkaria.postgresql.org; Thu, 19 Apr 2018 04:17:31 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f910j-0006uR-Ii for pgsql-general@lists.postgresql.org; Thu, 19 Apr 2018 04:17:31 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f910d-0007oc-Tl for pgsql-general@postgresql.org; Thu, 19 Apr 2018 04:17:28 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 6817F21ACC; Thu, 19 Apr 2018 00:17:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 19 Apr 2018 00:17:22 -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=DJCBx9FvkgRhs7aw4bu0ohDxEFTyX 9FFInKVo6iQh1I=; b=khezcGGkJJh6gLknWusXM7BkEG3jrLCinVOoWiXpnhXNj HUt/wYeFIpoQ4Wi8YkdWvkd/zCYXQPpO0qOqh/3NanIx3qhQ3LkcvhVNAb5IDz4Y dH/WoHjR4JhUb2YqRj6Nx7Jb7o25kedehZtmHF/n0yEMD0LvaSwTwl4kEpwf7vnf IXLyXH+750iAff+yGHEt0zV5QJcV4GQo3mXpMUGSkq8gfDykt+3KxpF8FASQzsKx 0Y+tU8mNh2It7cmg+PoZ/yPWrs/ZrE+awsbXxXY857BshlzWfW+qkRkjtzbhtQxi sKGNNs5heLBYfiATxharKZTWhc2DXoEojL78tpfQg== 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=DJCBx9 FvkgRhs7aw4bu0ohDxEFTyX9FFInKVo6iQh1I=; b=T2JZv0JPYmjTmd5Q6Rx8Ls l+t3NjEdNFUjGSxrTsknuxN0+fVb+LLr6YDox8/RDqbQGn8jyuEMYxyzGi+WZ41z UYBc2x8V8zGXWTOH0zL6QDjplvNwSeAEnkx4Cc9uCMk4AS2Xt4rqBjaX3lw9YTRi lhC/OxPqxXs07dks5NDVE2bxE8IsX8lVOX5fMPLAFisaR3IiyJqXNZ5I3/ENDIZe QHYxBAYzLnQeUsUsgK3EoD9A9qVmA2ZoZnQXNI7W5GovzQiT+4E+vjLh5IFMp2Qn K9xgd7cUNmUsB45DpbazaXmf1li1nANp9TgA0aXLVEc+TYhHrxwdCjNMnaFV+TFA == X-ME-Sender: Received: from [192.168.1.2] (unknown [71.212.135.74]) by mail.messagingengine.com (Postfix) with ESMTPA id A93B7E43EC; Thu, 19 Apr 2018 00:17:21 -0400 (EDT) Subject: Re: Inconsistent compilation error To: raf@raf.org, pgsql-general@postgresql.org References: <20180419010228.jcogqkeu2b7bxh2q@raf.org> From: Adrian Klaver Message-ID: Date: Wed, 18 Apr 2018 21:17:20 -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: <20180419010228.jcogqkeu2b7bxh2q@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/18/2018 06:02 PM, raf@raf.org wrote: > Hi, > > > But I'm getting this compilation error when it tries to load this > function: > > ERROR: too many parameters specified for RAISE > CONTEXT: compilation of PL/pgSQL function "tla_audit_delete_thing" near line 9 > > Traceback (most recent call last): > File "lib/loadfunc.py", line 228, in main > db.cursor().execute(src) > File "/usr/lib/python2.7/dist-packages/pgdb.py", line 1026, in execute > return self.executemany(operation, [parameters]) > File "/usr/lib/python2.7/dist-packages/pgdb.py", line 1050, in executemany > rows = self._src.execute(sql) > ProgrammingError: ERROR: too many parameters specified for RAISE > CONTEXT: compilation of PL/pgSQL function "tla_audit_delete_thing" near line 9 > > The line in question is: > > raise notice '% %', 'blah_history.original_id', r; > > Which looks fine. The really wierd thing is that this happens when done on a > debian9 host but when I load the function from another host (my macos laptop) > with the same function into the same database, it works fine. > > I've never encountered an inconsistency like this before. > > Any suggestions as to what might be causing it? > > The python versions are slightly different and the pgdb module versions > are different but I wouldn't have thought that that would affect the > compilation performed by the database server itself: > > debian9: python-2.7.13 pgdb-5.0.3 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." > macos-10.11.6: python-2.7.14 pgdb-4.2.2 > > And the sql sent to the database server is identical from both hosts. > > And I don't think anything much has changed on the debian host recently. > > And it's not just the old backup. The same is happening with other copies of > essentially the same database. > > And all the other stored functions were loaded fine. It's just this one that > went wrong. > > Thanks in advance for any insights you can share. > > cheers, > raf > > > -- Adrian Klaver adrian.klaver@aklaver.com