Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQsFk-0000vW-Lc for pgsql-general@arkaria.postgresql.org; Tue, 21 Apr 2020 12:43:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jQsFj-00051I-D8 for pgsql-general@arkaria.postgresql.org; Tue, 21 Apr 2020 12:43:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQsFi-00051B-VI for pgsql-general@lists.postgresql.org; Tue, 21 Apr 2020 12:43:51 +0000 Received: from forward100p.mail.yandex.net ([2a02:6b8:0:1472:2741:0:8b7:100]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQsFa-0004NM-Fi for pgsql-general@postgresql.org; Tue, 21 Apr 2020 12:43:49 +0000 Received: from forward102q.mail.yandex.net (forward102q.mail.yandex.net [IPv6:2a02:6b8:c0e:1ba:0:640:516:4e7d]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 3558C5982037 for ; Tue, 21 Apr 2020 15:43:26 +0300 (MSK) Received: from mxback6q.mail.yandex.net (mxback6q.mail.yandex.net [IPv6:2a02:6b8:c0e:42:0:640:9de5:975f]) by forward102q.mail.yandex.net (Yandex) with ESMTP id 313D87F20002 for ; Tue, 21 Apr 2020 15:43:26 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback6q.mail.yandex.net (mxback/Yandex) with ESMTP id JxdQhlRYKn-hPY0xDYM; Tue, 21 Apr 2020 15:43:25 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1587473005; bh=zXruo+C7H/X7esCzTVCkObXyGh24nD10o+roOGGzop0=; h=Message-Id:Date:Subject:To:From; b=NDGWxBK/PTb9c4hPxkpAy9ak0xriL/Ypw+xwb7bAcYDUjS9Sj2eRz0cm05SQTaMzc GQz0kPqFcNv/uWwP+gWIvGFVxBriNclFK3uJw2W3jx//k0MreZCPnEbQ6R4lsKskL0 QCtoVfr6yt3V3kF/bCp5tQZJ0wJlCc713ICWsU8k= Authentication-Results: mxback6q.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by vla5-e043431e7e8d.qloud-c.yandex.net with HTTP; Tue, 21 Apr 2020 15:43:25 +0300 From: =?utf-8?B?0JzQsNC30LvQvtCyINCS0LvQsNC00LjQvNC40YA=?= To: "pgsql-general@postgresql.org" Subject: Access control on the read replica MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 21 Apr 2020 15:43:25 +0300 Message-Id: <78061587470870@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/html; charset=utf-8 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk
Hi,
 
What I've been trying to do: write a web app that, upon receiving a request, automatically gets a DB connection with only the permissions it needs.
 
There are a number of solutions to this problem: you could use triggers/view, you could use security definer functions to grant/revoke permissions for a pool of roles. None of the solutions I've been able to come up with work on connections to the standby.
 
Does anything I've stated above strike you as obviously wrong? If not, do you perhaps have any ideas on how this problem could be tackled?
 
I would very much appreciate any ideas.
 
Cheers,
Vladimir