pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_restore with --use-list and --jobs and depdendencies
2+ messages / 2 participants
[nested] [flat]

* pg_restore with --use-list and --jobs and depdendencies
@ 2022-01-07 21:04  Wells Oliver <wells.oliver@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Wells Oliver @ 2022-01-07 21:04 UTC (permalink / raw)
  To: pgsql-admin

Hi all: I just wanted to clarify something for myself: how does pg_restore
determine restore order if you're using a --use-list and --jobs parameters.
Given the concurrency of jobs and (assuming) it goes in order of what's in
the list, does it... well, does it sort out dependencies properly so data
is inserted that foreign keys need, etc?

-- 
Wells Oliver
wells.oliver@gmail.com <wellsoliver@gmail.com>

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: pg_restore with --use-list and --jobs and depdendencies
@ 2022-01-07 22:26  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Wells Oliver <wells.oliver@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2022-01-07 22:26 UTC (permalink / raw)
  To: Wells Oliver <wells.oliver@gmail.com>; +Cc: pgsql-admin

Wells Oliver <wells.oliver@gmail.com> writes:
> Hi all: I just wanted to clarify something for myself: how does pg_restore
> determine restore order if you're using a --use-list and --jobs parameters.
> Given the concurrency of jobs and (assuming) it goes in order of what's in
> the list, does it... well, does it sort out dependencies properly so data
> is inserted that foreign keys need, etc?

(1) The basic order of the restored items is what you say in the --list
file, but it will start the next item as soon as (a) a worker is free
and (b) all of that item's dependencies are complete

(2) It will honor direct dependencies between restored items, ie
not start B till A is done if B is shown as depending on A

(3) I'm not too sure about indirect dependencies, ie if you have
a situation where C depends on B depends on A and you ask for just
A and C, that may end up with no dependency constraint delaying C.
Which might be fine, or it might not; you'd need to be more specific
about what you intend to skip.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2022-01-07 22:26 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07 21:04 pg_restore with --use-list and --jobs and depdendencies Wells Oliver <wells.oliver@gmail.com>
2022-01-07 22:26 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox