Re: Issue dumping schema using readonly user

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Melvin Davidson <melvin6925(at)gmail(dot)com>
Cc: Daniel LaMotte <lamotte85(at)gmail(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Issue dumping schema using readonly user
Date: 2015-02-17 23:19:42
Message-ID: 20150217231942.GG6717@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Melvin,

* Melvin Davidson (melvin6925(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2015-02-17 23:28:53 Re: Issue dumping schema using readonly user
Previous Message Melvin Davidson 2015-02-17 23:14:39 Re: Issue dumping schema using readonly user