Re: Docs pg_restore: Shouldn't there be a note about -n ?

From: Florents Tselai <florents(dot)tselai(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Docs pg_restore: Shouldn't there be a note about -n ?
Date: 2024-09-25 22:28:16
Message-ID: CA+v5N42e8CWE-GExcFwEWeT8UDmb61_JChpLC_4KqmRFA_5wtg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Sep 21, 2024 at 9:48 PM Florents Tselai <florents(dot)tselai(at)gmail(dot)com>
wrote:

>
>
> > On 21 Sep 2024, at 9:22 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >
> > Florents Tselai <florents(dot)tselai(at)gmail(dot)com> writes:
> >> Ah, swapped them by mistake on the previous email:
> >> They're both available in the pg_dump and note on -n missing in
> pg_restore.
> >> The question remains though:
> >> Shouldn’t there be a note about -n in pg_restore ?
> >
> > Probably. I see that pg_dump has a third copy of the exact same
> > note for "-e". pg_restore lacks that switch for some reason,
> > but this is surely looking mighty duplicative. I propose getting
> > rid of the per-switch Notes and putting a para into the Notes
> > section, along the lines of
> >
> > When -e, -n, or -t is specified, pg_dump makes no attempt to dump
> > any other database objects that the selected object(s) might
> > depend upon. Therefore, there is no guarantee that the results of
> > a selective dump can be successfully restored by themselves into a
> > clean database.
>
> Agree with that, but I think there should be a pointer like “see Notes” .
> Otherwise I’m pretty sure most would expect pg doing magic.
> Can’t remember I scrolledl to the bottom of a page “notes” after finding
> the option I want.
>
> I would also add an example of what “depend upon” means,
> To underline that it’s really not that uncommon.
> Something like:
> “If you pg_dump only with -t A and A has foreign key constraints to table
> B,
> Those constraints won’t succeed If B has not been already restored”
>
>
Attached an idea.
The A/B example may be wordy / redundant,
but the -e note on the distinction between installing binaries / creating
an extension I think it's important.

Attachment Content-Type Size
v1-0001-Note-on-e-t-n.patch application/octet-stream 4.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2024-09-25 22:46:27 Re: pg_trgm comparison bug on cross-architecture replication due to different char implementation
Previous Message Tom Lane 2024-09-25 21:03:57 Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part