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 1hRJae-0000si-BR for pgsql-general@arkaria.postgresql.org; Thu, 16 May 2019 16:50: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 1hRJad-0006ye-2z for pgsql-general@arkaria.postgresql.org; Thu, 16 May 2019 16:50: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 1hRJac-0006yB-Ls for pgsql-general@lists.postgresql.org; Thu, 16 May 2019 16:50:42 +0000 Received: from 24-182-127-154.static.stls.mo.charter.com ([24.182.127.154] helo=mail.brookhurstdata.net) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hRJaa-0003DU-DJ for pgsql-general@lists.postgresql.org; Thu, 16 May 2019 16:50:41 +0000 Received: from mail.brookhurstdata.net (mail.brookhurstdata.net [10.1.5.12]) by mail.brookhurstdata.net (Postfix) with ESMTP id 60FFE889020 for ; Thu, 16 May 2019 11:50:39 -0500 (CDT) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 16 May 2019 11:50:39 -0500 From: Susan Hurst To: Discuss List Postgres Subject: Permissions for =?UTF-8?Q?information=5Fschema?= Organization: Brookhurst Data LLC Reply-To: susan.hurst@brookhurstdata.com Mail-Reply-To: susan.hurst@brookhurstdata.com Message-ID: X-Sender: susan.hurst@brookhurstdata.com User-Agent: Roundcube Webmail/RCMAIL_VERSION List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk What are the correct permissions to give to a role so that all objects in the information_schema (and pg_catalog) are visible to a user? Permissions seem to make a difference but I don't know which adjustments to make without causing unintended consequences. We revoked select on all tables and functions from public, if that makes a difference. We don't use the public schema but it appears that postgres does. Should I be looking at something other than permissions to make information_schema more visible? We are particularly interested in using the comments on everything to create views of our database structures that we can use for our team's training documentation. Of course, the comments/descriptions can't be selected in isolation so we need full visibility. Below are samples of select statements with outputs that disagree based upon the database and presumably, the permissions. Thanks for your help! Sue Production db logged in as admin: CREATE ROLE admin LOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; GRANT read TO admin; GRANT write TO admin; select * from information_schema.table_constraints; -- 206 rows select * from information_schema.constraint_column_usage; -- 0 rows sandbox db logged in as postgres: CREATE ROLE postgres LOGIN ENCRYPTED PASSWORD 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' SUPERUSER INHERIT CREATEDB CREATEROLE REPLICATION; select * from information_schema.table_constraints; -- 621 rows select * from information_schema.constraint_column_usage; -- 127 rows -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Susan E Hurst Principal Consultant Brookhurst Data LLC Email: susan.hurst@brookhurstdata.com Mobile: 314-486-3261