Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hqKrg-0001cm-Gy for pgsql-admin@arkaria.postgresql.org; Wed, 24 Jul 2019 17:15:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hqKrf-0002zm-BU for pgsql-admin@arkaria.postgresql.org; Wed, 24 Jul 2019 17:15:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hqKre-0002zQ-Vz for pgsql-admin@lists.postgresql.org; Wed, 24 Jul 2019 17:15:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hqKrc-0001aT-PX for pgsql-admin@lists.postgresql.org; Wed, 24 Jul 2019 17:15:41 +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 x6OHFdBk030894; Wed, 24 Jul 2019 13:15:39 -0400 From: Tom Lane To: "David G. Johnston" cc: Swanand Kshirsagar , "pgsql-admin@lists.postgresql.org" Subject: Re: Restrict permissions on schema to hide pl/pgsql code In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Wed, 24 Jul 2019 10:08:11 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <30892.1563988539.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 24 Jul 2019 13:15:39 -0400 Message-ID: <30893.1563988539@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > You can consider this email to have accomplished both. Lacking someone > saying they they are working on it and pointing you to a patch you can > safely operate under the assumption that this behavior isn’t going to > change. It isn't. We've considered complaints like this before and determined that we're not going to do anything about it. For better or worse, the PG catalogs are readable by any authorized user, with only narrow exceptions (like password columns). A sufficiently determined person could perhaps do something like creating their own PL that stores encrypted function source text in pg_proc, and just hands it off to an existing PL after decryption. I'm not exactly sure where you'd keep the decryption key though. regards, tom lane