Re: Restoring database from backup

2024-12-13 Thread Rich Shepard
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 overw

Re: Restoring database from backup

2024-12-13 Thread Adrian Klaver
On 12/13/24 11:18 AM, Rich Shepard wrote: On Fri, 13 Dec 2024, Adrian Klaver wrote: This needs more information: 1) Have you backed up your database at the current state? Adrian, No, the current state is FUBAR'd. The cron backup script runs each night at 11:15 p.m. 2) What command did

Re: Restoring database from backup

2024-12-13 Thread Rich Shepard
On Fri, 13 Dec 2024, Rich Shepard wrote: #!/usr/bin/bash The line was separated. Rich

Re: Restoring database from backup

2024-12-13 Thread Rich Shepard
On Fri, 13 Dec 2024, Adrian Klaver wrote: This needs more information: 1) Have you backed up your database at the current state? Adrian, No, the current state is FUBAR'd. The cron backup script runs each night at 11:15 p.m. 2) What command did you use to create bustrac-2024-12-12.sql? !/

Re: Restoring database from backup

2024-12-13 Thread Adrian Klaver
On 12/13/24 11:15 AM, Rich Shepard wrote: On Fri, 13 Dec 2024, Ron Johnson wrote: It's a text file.  Open it up, and see if there's a DROP DATABASE in there. Ron, No `drop database' but it drops constraints and tables. I could add a drop database to the backup script after restoring yeste

Re: Restoring database from backup

2024-12-13 Thread Rich Shepard
On Fri, 13 Dec 2024, Ron Johnson wrote: It's a text file. Open it up, and see if there's a DROP DATABASE in there. Ron, No `drop database' but it drops constraints and tables. I could add a drop database to the backup script after restoring yesterday's status. Thanks, Rich

Re: Restoring database from backup

2024-12-13 Thread Adrian Klaver
On 12/13/24 10:21 AM, Rich Shepard wrote: I made a careless error this morning and want to restore the database from yesterday's backup, `bustrac-2024-12-12.sql'. If I run psql -d bustrac -f bustrac-2024-12-12.sql will this restore the database to yesterday's status without first deleting/re

Restoring database from backup

2024-12-13 Thread Rich Shepard
I made a careless error this morning and want to restore the database from yesterday's backup, `bustrac-2024-12-12.sql'. If I run psql -d bustrac -f bustrac-2024-12-12.sql will this restore the database to yesterday's status without first deleting/removing the FUBAR'd one? TIA, Rich