Re: pg_dump LOCK TABLE ONLY question

From: Filip Rembiałkowski <filip(dot)rembialkowski(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump LOCK TABLE ONLY question
Date: 2015-10-01 13:43:17
Message-ID: CAP_rwwnFO6NC4vB0WpSO239tYbCCT8d6r4nE+5raxZtShOa3HQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2015-10-01 13:44:38 Re: Freeze avoidance of very large table.
Previous Message Tom Lane 2015-10-01 13:31:35 Re: Typo in /src/backend/optimizer/README