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 1g5exp-0002Je-FQ for pgsql-general@arkaria.postgresql.org; Thu, 27 Sep 2018 22:40:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5exn-0002aj-Rd for pgsql-general@arkaria.postgresql.org; Thu, 27 Sep 2018 22:40:51 +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 1g5exn-0002ab-Jf for pgsql-general@lists.postgresql.org; Thu, 27 Sep 2018 22:40:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5exl-00023m-KR for pgsql-general@lists.postgresql.org; Thu, 27 Sep 2018 22:40:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w8RMel9w020796; Thu, 27 Sep 2018 18:40:47 -0400 From: Tom Lane To: Jan Kowalski cc: pgsql-general@lists.postgresql.org Subject: Re: Lost permission In-reply-to: <1538085606.6107.32.camel@sem-jarek-01.prv> References: <1538085606.6107.32.camel@sem-jarek-01.prv> Comments: In-reply-to Jan Kowalski message dated "Fri, 28 Sep 2018 00:00:06 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20794.1538088047.1@sss.pgh.pa.us> Date: Thu, 27 Sep 2018 18:40:47 -0400 Message-ID: <20795.1538088047@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jan Kowalski writes: > I've strange problem with Pyramid application working with postgresql > over psycopg2. > After some period of operation, my application insert new row to one of > tables with the message: > ERROR: permission denied for relation ... > After restart of application, it starts to work properly again. Couple of possible ideas: * something in your app sometimes issues SET ROLE or SET SESSION AUTHORIZATION. * you're using a connection pooler and it sometimes reconnects you to a connection with the wrong user ID. Neither of these seem terribly likely, but whatever it is has to be weird ... regards, tom lane