Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fih7A-0003X9-Qf for pgsql-general@arkaria.postgresql.org; Thu, 26 Jul 2018 14:19:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fih78-0005XX-AN for pgsql-general@arkaria.postgresql.org; Thu, 26 Jul 2018 14:19:34 +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 1fih72-000513-3Z for pgsql-general@lists.postgresql.org; Thu, 26 Jul 2018 14:19:28 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fih6x-0003SC-HL for pgsql-general@lists.postgresql.org; Thu, 26 Jul 2018 14:19:26 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 2606221F92; Thu, 26 Jul 2018 10:19:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 26 Jul 2018 10:19:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc: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=fm3; bh=ldvQLDcMH70sDWUBCPLSAtnhYw3nn 425SPIO4inu56Y=; b=jk1mjZrSdIpQCIPucVRlLL9+90IwX5Blk/vbW98CiHjgJ 6NA7c2a3jDt4Vaj2APToxtz9OiAq2M+hU5lV0JV0A8ay8LEi+bDipvLX3t8Wn8lj FjFpENivM8BI+Mky7wseS03fyU7jIUF3yuAXlCUhgAOglQpubunzc4nZ/53noGME mx35jPo8zuxHU9flmwesyizDECqj+yUt/xQ8u0K0UWqeo+GaJ6qGf4rdzlXMwvBj D4eU7RZOQZ9944ZTxkfDU2MGn4p9ugrDgee0cfxkp4V/wj/BVf9QlwiUFS3a0yH8 YgUN2+SwsU/IWJqxrXTdADMkeeZYre0iYOiGWQFsg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm3; bh=ldvQLD cMH70sDWUBCPLSAtnhYw3nn425SPIO4inu56Y=; b=TeyaUidPivdAyeZFxqEPq1 Cge4l9Efq1Cb51n2Pa+AA24VeFxO4v1DnuSQxCsrUgxXoqWaqLIPjIUFj59BBrxa jLoPDf1NQ+rWi4t5OgwTNYf9Vz7pQ4/npJcReiDzZLZQ62iwhVlt5JvDY6+I1ema 5zuv4CzfIC9t8y4xHK4njMAq//ICASrsDQbEat1Zmrav0vVFSC4Tcnf+EdZu3qL7 t3HsnRcFTauYbG5I2FKiUHty6Lc+k7fvxR99xRBDrXV5P8mPP3hlTL4FN1IaxTiR ssWws5FF1iQskFdZLtRZ+zDU7KwN04Y7kavQ/KXITXzPQSy1ZHBkF8TSZlXNA2gw == X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.134.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 4DCEBE4ABA; Thu, 26 Jul 2018 10:19:21 -0400 (EDT) Subject: Re: Permission denied on schema for all users on insert to table with fk To: Leland Weathers Cc: pgsql-general@lists.postgresql.org References: <0357d12a-2b1e-14ac-b9b5-7b0062c529fc@aklaver.com> From: Adrian Klaver Message-ID: <67f4fb8e-e314-8c08-e13a-08f273fd58d8@aklaver.com> Date: Thu, 26 Jul 2018 07:19:20 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: 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 07/26/2018 06:57 AM, Leland Weathers wrote: > > > Before you mentioned a trigger. I am not seeing that in the schema > you sent. Is there one and if so what is it's definition and that of > its associated function? > > > I was referring to the "built-in" PostgreSQL system trigger for > validating fk constraints are met. The trigger that uses the "SELECT 1 > FROM ONLY..." query. That particular query which the logs say I don't > have permissions to execute is not part of my schema/code. > > > What does show?: > > select session_user, current_user; > > > For this particular example, the session_user is: lw, current_user is > dba (database and schema owner role) So if I am following neither of these roles have permissions on the tables. Is that correct? If you try the INSERT as system_admin, jb or gb does it work? > > > INSERT INTO results.historyitem > (batchid,datasourceid,sequence_order) VALUES (6,20,1); > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > -- Adrian Klaver adrian.klaver@aklaver.com