On 2 October 2015 at 01:19, Michael Paquier <michael.paqu...@gmail.com> wrote:
> On Thu, Oct 1, 2015 at 10:43 PM, Filip RembiaĆkowski > <filip.rembialkow...@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/ <http://www.2ndquadrant.com/> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services