Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjbmD-0002Ec-I6 for pgsql-jdbc@arkaria.postgresql.org; Tue, 13 Sep 2016 00:40:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bjbmC-00015H-So for pgsql-jdbc@arkaria.postgresql.org; Tue, 13 Sep 2016 00:40:40 +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.84_2) (envelope-from ) id 1bjbli-0000Uo-6A for pgsql-jdbc@postgresql.org; Tue, 13 Sep 2016 00:40:10 +0000 Received: from smtp694.redcondor.net ([208.80.206.94]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bjblc-00086N-Ss for pgsql-jdbc@postgresql.org; Tue, 13 Sep 2016 00:40:08 +0000 Received: from mailproxy4.av-mx.com ([137.118.40.134]) by smtp694.redcondor.net ({c8ad8081-e921-4f15-9a53-034744fe478f}) via TCP (outbound) with ESMTP id 20160913003958208_0694; Tue, 13 Sep 2016 00:39:58 +0000 X-RC-FROM: Received: from [192.168.157.52] (unknown [76.75.5.113]) (Authenticated sender: danap@itstriangle.com) by mailproxy4.av-mx.com (Postfix) with ESMTPA id B31088012B; Mon, 12 Sep 2016 20:39:52 -0400 (EDT) Subject: Re: Filtering DatabaseMetaData to show only the items for which the current user has access To: slangley@scharp.org, PostgreSQL JDBC References: <338A7B0E9A69874B9D933A0B0D2527A4E708469E@adama.fhcrc.org> From: danap Message-ID: <57D74D7E.8070907@itstriangle.com> Date: Mon, 12 Sep 2016 18:51:10 -0600 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40 MIME-Version: 1.0 In-Reply-To: <338A7B0E9A69874B9D933A0B0D2527A4E708469E@adama.fhcrc.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-DLP-OUTBOUND: 137.118.40.128/25 X-MAG-OUTBOUND: greymail.redcondor.net@137.118.40.128/25 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Langley, Scott E wrote: > Hello PostgreSQL JDBC Developers, > > We have a desire to hide unneeded database objects from our database-challenged > users - as they might see in a simple database viewer application - by removing > their privileges on such objects. > > It appears that many database viewing applications, e.g., DbVisualizer, rely on > what is returned by the JDBC driver’s DatabaseMetaData methods to determine > which schemas and tables to display to the user: > > ~ > ~ > ~ > > If you would accept a patch along these lines, which approach would be preferable? > > Thanks for your consideration. > Scott Langley Seems what you are asking the JDBC driver to do is the work of what should be done by a client application. Yes MySQL does offer this more advanced control of users. Most of this can be accomplished as indicated, filtering through the DatabaseMetaData.getTables(catalog, schemaPattern, tableNamePattern, tableTypes) MyJSQLView does exactly this and some basic filtering can be accomplished via a configuration file, myjsqlview.conf. If not edit the DatabaseProperties Java code to only allow, the particular aspects desired. This might be much easier then editing the JDBC code to add this feature. Overall seems the additional control should be requested via the server features. danap http://myjsqlview.com -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc