Re: Preventing database listing? - Mailing list pgsql-general

From John R Pierce
Subject Re: Preventing database listing?
Date
Msg-id 4ADFED35.7000204@hogranch.com
Whole thread Raw
In response to Preventing database listing?  (Adam Rich <adam.r@sbcglobal.net>)
List pgsql-general
Adam Rich wrote:
>
> This seems like a simple question that would have come up, but I'm not
> able to find an answer in google, PG docs, or PG mailing list archives.
>
> How do I prevent a user from being able to list all databases in my
> cluster?  I want to restrict them to seeing just the databases they
> have connect rights to.


the \l command that lists all databases excutes a query like...

SELECT d.datname as "Name",
       r.rolname as "Owner",
       pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding"
FROM pg_catalog.pg_database d
  JOIN pg_catalog.pg_roles r ON d.datdba = r.oid
ORDER BY 1;

so, perhaps revoking read permissions on pg_catalog.pg_database, but I
have no idea what other problems that might cause





pgsql-general by date:

Previous
From: Sam Jas
Date:
Subject: Re: postgres doesn't start after crash
Next
From: Mike Christensen
Date:
Subject: Design question about partitioning order information across tables