As a user with admin privileges in postgres, I can psql database_name and then invoke \dt to see a list of relations. As the same (unix) user, I execute psql -h localhost -U non-privileged-user table_name, and \dt reports NO relations found. The only host entries in pg_hba.conf are of the form host analytics all md5 (where is the first entry).

Where are the relations? Why are they not visible to the alternate user. What schema tables should I look in to debug. Also, note that grant select on table_name to non-privileged-user works just fine.

  • 1
    Nit-pick (not much relevant to the issue): when you psql x you login and connect to the database called x, not to a table named x. Apr 11, 2017 at 14:10
  • 2
    pg_hba.conf is irrelevant to the question because it only controls if a user is allowed to connect at all. But it does not control what the user can see once connected.
    – user1822
    Apr 11, 2017 at 14:49

1 Answer 1


What you see typically happens when the non-privileged user doesn't have schema level privileges. In this case, they cannot list the objects inside the given schema - with the command you tried. See the below example:

-- as a superuser, for example
\c test
CREATE TABLE public.blah (id integer);

CREATE USER u WITH PASSWORD 'u'; -- don't do this in production

-- connect as u
\c test u
No relations found.

-- but:
\dt public.*
       List of relations
 Schema │ Name │ Type  │ Owner  
 public │ blah │ table │ dezso

See what the documentation says:


For schemas, allows access to objects contained in the specified schema (assuming that the objects' own privilege requirements are also met). Essentially this allows the grantee to "look up" objects within the schema. Without this permission, it is still possible to see the object names, e.g. by querying the system tables. [...]

\dt does the latter, namely queries pg_class and pg_namespace to find matching objects. Apparently, when the schema name is not specified, the system wants to hide objects from view.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.