public inbox for [email protected]
help / color / mirror / Atom feedFrom: Rich Shepard <[email protected]>
To: [email protected]
Subject: Re: Restoring database from backup
Date: Fri, 13 Dec 2024 11:26:37 -0800 (PST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
On Fri, 13 Dec 2024, Adrian Klaver wrote:
> Alright, from here:
>
> https://www.postgresql.org/docs/current/app-pgdump.html
>
> "-c
> --clean
>
> Output commands to DROP all the dumped database objects prior to
> outputting the commands for creating them. This option is useful when the
> restore is to overwrite an existing database. If any of the objects do not
> exist in the destination database, ignorable error messages will be reported
> during restore, unless --if-exists is also specified.
>
> This option is ignored when emitting an archive (non-text) output file.
> For the archive formats, you can specify the option when you call pg_restore.
> "
>
> This means when you run the script with:
>
> psql -d bustrac -f bustrac-2024-12-12.sql
>
> it will clean out the current corrupted objects and replace them with those
> in the backup file.
Adrian,
That's what I thought since I wrote the script based on reading pgdump a
long time ago.
Thanks for confirming! I'll fix my carelessness now.
Carpe weekend,
Rich
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: Restoring database from backup
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox