pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_dump directory format and proper ordering
4+ messages / 2 participants
[nested] [flat]
* pg_dump directory format and proper ordering
@ 2021-06-11 01:32 Wells Oliver <wells.oliver@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Wells Oliver @ 2021-06-11 01:32 UTC (permalink / raw)
To: pgsql-admin
Hi: I wanted to check on something: if I pg_dump four schemas in directory
format with a selection of schemas, and then pg_restore, I'm assuming psql
will know the order of priority for restoration, meaning it will restore
schema A first if schema B/C/D depend on those entities, right?
--
Wells Oliver
wells.oliver@gmail.com <wellsoliver@gmail.com>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_dump directory format and proper ordering
@ 2021-06-11 01:56 Tom Lane <tgl@sss.pgh.pa.us>
parent: Wells Oliver <wells.oliver@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Tom Lane @ 2021-06-11 01:56 UTC (permalink / raw)
To: Wells Oliver <wells.oliver@gmail.com>; +Cc: pgsql-admin
Wells Oliver <wells.oliver@gmail.com> writes:
> Hi: I wanted to check on something: if I pg_dump four schemas in directory
> format with a selection of schemas, and then pg_restore, I'm assuming psql
> will know the order of priority for restoration, meaning it will restore
> schema A first if schema B/C/D depend on those entities, right?
It tracks dependencies at the per-object level. I'm not aware of any
way that a schema as such could depend on another, but it should take
care of correct restoration order for the objects within them.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_dump directory format and proper ordering
@ 2021-06-11 03:37 Wells Oliver <wells.oliver@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 4+ messages in thread
From: Wells Oliver @ 2021-06-11 03:37 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin
Is there a potential issue when restoring in parallel?
I notice for example it fails to re-create some mat views I have in schema
B as they query from some table in schema A that hasn't been created yet at
that moment.
On Thu, Jun 10, 2021 at 6:56 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Wells Oliver <wells.oliver@gmail.com> writes:
> > Hi: I wanted to check on something: if I pg_dump four schemas in
> directory
> > format with a selection of schemas, and then pg_restore, I'm assuming
> psql
> > will know the order of priority for restoration, meaning it will restore
> > schema A first if schema B/C/D depend on those entities, right?
>
> It tracks dependencies at the per-object level. I'm not aware of any
> way that a schema as such could depend on another, but it should take
> care of correct restoration order for the objects within them.
>
> regards, tom lane
>
--
Wells Oliver
wells.oliver@gmail.com <wellsoliver@gmail.com>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_dump directory format and proper ordering
@ 2021-06-11 03:54 Tom Lane <tgl@sss.pgh.pa.us>
parent: Wells Oliver <wells.oliver@gmail.com>
0 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2021-06-11 03:54 UTC (permalink / raw)
To: Wells Oliver <wells.oliver@gmail.com>; +Cc: pgsql-admin
Wells Oliver <wells.oliver@gmail.com> writes:
> Is there a potential issue when restoring in parallel?
Not supposed to be ...
> I notice for example it fails to re-create some mat views I have in schema
> B as they query from some table in schema A that hasn't been created yet at
> that moment.
You can break it with user-defined functions, because pg_dump can't
really see into the function bodies to understand what they might
reference. But a matview that doesn't contain anything like that
should Just Work. If you have a counterexample (against a reasonably
recent PG version), please file a bug report.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2021-06-11 03:54 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 01:32 pg_dump directory format and proper ordering Wells Oliver <wells.oliver@gmail.com>
2021-06-11 01:56 ` Tom Lane <tgl@sss.pgh.pa.us>
2021-06-11 03:37 ` Wells Oliver <wells.oliver@gmail.com>
2021-06-11 03:54 ` 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