Re: pg_dump LOCK TABLE ONLY question - Mailing list pgsql-hackers

From Filip Rembiałkowski
Subject Re: pg_dump LOCK TABLE ONLY question
Date
Msg-id CAP_rwwnFO6NC4vB0WpSO239tYbCCT8d6r4nE+5raxZtShOa3HQ@mail.gmail.com
Whole thread Raw
In response to pg_dump LOCK TABLE ONLY question  (Filip Rembiałkowski <filip.rembialkowski@gmail.com>)
Responses Re: pg_dump LOCK TABLE ONLY question
List pgsql-hackers
(sorry I lost the original thread somehow)

tgl wrote:

> Filip wrote:

> > I'm running pg_dump constrained to one schema. It appears that pg_dump runs
> > "LOCK TABLE %s IN ACCESS SHARE MODE" for each table.
> > Naturally it makes sense, but...

> > This schema has a table that serves as parent for thousands of child
> > tables (via INHERITS).

> > So effectively, to dump this schema, I have to LOCK all these tables
> > not only parent.

> They'd all end up locked anyway wouldn't they?

I would like to dump the whole schema in ONLY mode, including table
data for only that schema, excluding data for child tables in other
schemas.

Why would they be locked then?

Which part of pg_dump requires locking child tables?

Per the docs, "COPY only deals with the specific table named; it does
not copy data to or from child tables. "


I just want to understand why there is LOCK TABLE not LOCK TABLE ONLY.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Typo in /src/backend/optimizer/README
Next
From: Fujii Masao
Date:
Subject: Re: Freeze avoidance of very large table.