Re: Issue dumping schema using readonly user - Mailing list pgsql-general

From Stephen Frost
Subject Re: Issue dumping schema using readonly user
Date
Msg-id 20150217231942.GG6717@tamriel.snowman.net
Whole thread Raw
In response to Re: Issue dumping schema using readonly user  (Melvin Davidson <melvin6925@gmail.com>)
List pgsql-general
Melvin,

* Melvin Davidson (melvin6925@gmail.com) wrote:
> Simply put, giving access to a schema DOES NOT automatically give access to
> any table in the schema. So if you want a specific user ( or role) to be
> able to read (or pg_dump) all tables in the schema, then you must GRANT
> SELECT of all tables in that schema to the user (or role).

That's not the question at hand, however.  He's not asking about
dumping out the records of the table but rather about pulling out the
schema, which any user can do, regardless of their permissions on the
tables.  There's no need to 'grant select' access on a table, or even
to 'grant usage' on the schema, simply issue queries against the
catalog.

pg_dump is going beyond what's strictly necessary for a schema-only dump
though, it's trying to lock all of the tables too, which really isn't
necessary in this case.

    Thanks,

        Stephen

Attachment

pgsql-general by date:

Previous
From: Melvin Davidson
Date:
Subject: Re: Issue dumping schema using readonly user
Next
From: Tom Lane
Date:
Subject: Re: Issue dumping schema using readonly user