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 1f903j-0008Oa-PB for pgsql-general@arkaria.postgresql.org; Thu, 19 Apr 2018 03:16:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f903i-0002k3-G7 for pgsql-general@arkaria.postgresql.org; Thu, 19 Apr 2018 03:16:30 +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 1f903g-0002jm-FY for pgsql-general@lists.postgresql.org; Thu, 19 Apr 2018 03:16:30 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f903b-0002SB-Sp for pgsql-general@postgresql.org; Thu, 19 Apr 2018 03:16:27 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 92AEC21AC5; Wed, 18 Apr 2018 23:16:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 18 Apr 2018 23:16:21 -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=EWZ57FQQ84lLYtXPpGZiFQtVtk8e9 zLSEC/86BcS7Ps=; b=DcgzoNoWsXTV0S4bbnc4BzF/Z41pzD4WU3RI9rteMdmbC tFOvRNOxpOesOIRlzz2pjKWC0rryn69uXXCNjIlh0mShceIIGnQAa8NDI/tG/Sp0 vjbtL1aVUFv7dHmvij+VTHgFOljEu1K1+0D1HpfRO58RbZRbHQmkLTuOjs4PpykZ nDLB6KgXyF/UTQSQ0xdPMQN1UIVGyj+2cc9pPYCmS1HjcwMZ1rzgRhux+UiU6Itr iaHXenJsfO9pK+mXrBqnqU6fGlywXJfzMvIkmAYsaxXEE/YMGQh/ekzh8b0lgY74 NhFBBz794h2hxQqyxfR69WpTa0omCnxCGbCSOKIvw== 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=EWZ57F QQ84lLYtXPpGZiFQtVtk8e9zLSEC/86BcS7Ps=; b=Elf2e1vRPrccSqUs6hOU3m kRMoVfxxOpn6/OJjlT+5lZaPcUvhuNG0PGdOwPgyQ002FzjMv5vjkPKBfutfBWnx UHDHHwJHUdqZDGpOOYPQKLBbkG225+EUEZOYieZdGj2qF/5gVxxyfOQEu0kWv+4p MIl1Y+lKtVOJp0D2PJPq8utpueXy4E5/t33Z1TGnZsECViE4s57DN/ET+qLSrHD1 swlm/yT54ZIX9YL9hwZnYW3X/AXFqiX+55931jZDOCcV0zrtq/ZEfu9H9Tz6uR8d YEvbVy6kWo/At0EaXRNRx3rNNXW4qR6aVLfIShj9/6BBe29wS/EX305t7cnfB0gQ == X-ME-Sender: Received: from [192.168.1.2] (unknown [71.212.135.74]) by mail.messagingengine.com (Postfix) with ESMTPA id F3F57E4445; Wed, 18 Apr 2018 23:16:20 -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: <938e3908-6dc2-7a6b-40d9-04a29c4f4c3f@aklaver.com> Date: Wed, 18 Apr 2018 20:16: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, > > postgresql-9.5.12 on debian-9 > > I have a stored function with code that looks like: > > create or replace function tla_audit_delete_thing() > returns boolean stable language plpgsql as $$ > declare > r record; > status boolean := 1; > begin > for r in select _.* from blah_history _ where _.original_id not in (select id from blah) > loop > raise notice '% %', 'blah_history.original_id', r; > status := 0; > end loop; > [...] > end > $$ > security definer > set search_path = public, pg_temp; > revoke all on function tla_audit_delete_thing() from public; > grant execute on function tla_audit_delete_thing() to staff; So if you cut and paste the above directly into the database via psql on the Debian host do you see the same issue? > > And I have a program that loads stored functions from disk > when they are different to what's in the database and I have > just loaded a very old database backup, brought the schema up > to date, and tried to bring the stored functions up to date. > > > cheers, > raf > > > -- Adrian Klaver adrian.klaver@aklaver.com