Re: Issue dumping schema using readonly user

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Issue dumping schema using readonly user
Дата
Msg-id 20150217224150.GD6717@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: Issue dumping schema using readonly user  (Daniel LaMotte <lamotte85@gmail.com>)
Ответы Re: Issue dumping schema using readonly user  (Melvin Davidson <melvin6925@gmail.com>)
Re: Issue dumping schema using readonly user  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Daniel,

* Daniel LaMotte (lamotte85@gmail.com) wrote:
> I understand this.  This is the behavior I want.  What I don't understand
> is why the readonly user can inspect the schema of the table interactively
> when pg_dump refuses to do the same via the command line (assumably it asks
> for too much permission when simply trying to dump the schema [NOT the
> table data]).  I do not care about the data.  I only care that the pg_dump
> would emit "CREATE TABLE ..." statements for the table.
>
> The --schema-only option makes me think that it would emit only these
> CREATE TABLE ... statements and not the COPY statements (which consist of
> table data).

The issue is that pg_dump wants to lock the table against changes, which
is really to prevent the table to change between "we got the definition
of the table" and "pulling the records out of the table."  It's not
immediately obvious, to me at least, that there's really any need to
lock the tables when doing a schema-only dump.  Accesses to the catalogs
should be consistent across the lifetime of the transaction which
pg_dump is operating in and a schema-only dump isn't doing anything
else.

So, for my 2c, it seems like we should be able avoid issuing the LOCK
TABLE statements when we're doing a schema-only dump and then this would
work.

    Thanks!

        Stephen

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Steve Boyle
Дата:
Сообщение: BDR Monitoring, missing pg_stat_logical_decoding view
Следующее
От: Saimon
Дата:
Сообщение: Revoking access for pg_catalog schema objects