Re: pg_dump LOCK TABLE ONLY question

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: pg_dump LOCK TABLE ONLY question
Дата
Msg-id CANP8+jKY_T=8wteGFidbnQi+9iRQ02JVHop77NVGWVDMhHNd1Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_dump LOCK TABLE ONLY question  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: pg_dump LOCK TABLE ONLY question  (Noah Misch <noah@leadboat.com>)
Список pgsql-hackers
On 2 October 2015 at 01:19, Michael Paquier <michael.paquier@gmail.com> wrote:
On Thu, Oct 1, 2015 at 10:43 PM, Filip Rembiałkowski
<filip.rembialkowski@gmail.com> wrote:
> I just want to understand why there is LOCK TABLE not LOCK TABLE ONLY.

It seems to me that you'd still want to use LOCK TABLE particularly if
the dump is only done on a subset of tables, using --table for
example.

I agree with Filip that this is a bug. pg_dump clearly doesn't work correctly with inheritance.

If I run this command

  pg_dump -t tab1

then I get a dump of "tab1".  No data is included from tables that inherit tab1 because COPY refers only to the target table.

Why should that action cause a lock to be taken on another table that inherits from tab1?

It seems clear that the user is requesting an action ONLY on tab1, so we should use LOCK TABLE tab1 ONLY;

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: September 2015 Commitfest
Следующее
От: konstantin knizhnik
Дата:
Сообщение: eXtensible Transaction Manager API