Re: restore question

From: Benedict Holland <benedict(dot)m(dot)holland(at)gmail(dot)com>
To: Ronald Haynes <rhaynes74(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>, "Ray O'Donnell" <ray(at)rodonnell(dot)ie>
Subject: Re: restore question
Date: 2022-07-19 16:49:26
Message-ID: CAD+mzowsiwyffLyKOfFo8ambG7LQcMREsZn-7Sc_LCOz_BagvA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You have to create the database to restore to. Then pg_resrore should work.

Thanks,
Ben

On Tue, Jul 19, 2022, 12:44 PM Ronald Haynes <rhaynes74(at)gmail(dot)com> wrote:

> Thanks Ray, running
>
> pSql -f backup-file.sql
>
>
>
> psql: error: FATAL: database "rhaynes74" does not exist
>
> Which seems odd since rhaynes74 is a user not a database name in the file.
>
> Sincerely,
>
> Dr. Ronald D. Haynes
> Professor, Department of Mathematics and Statistics
> Chair, MSc and Phd Scientific Computing Programs
> Memorial University of Newfoundland
>
> *We acknowledge that the lands on which Memorial University’s campuses are
> situated are in the traditional territories of diverse Indigenous groups,
> and we acknowledge with respect the diverse histories and cultures of the
> Beothuk, Mi’kmaq, Innu, and Inuit of this province.*
> On Jul 19, 2022, 9:40 AM -0230, Ray O'Donnell <ray(at)rodonnell(dot)ie>, wrote:
>
> On 19/07/2022 11:11, Ronald Haynes wrote:
>
> Hi folks, I am a fairly novice postgresql user.
>
>
>
> I have a backup file for a couple of small postgresql databases. The
> backup file was created using postgresql 12.2, my Mac now has a
> postgresql 13.x or 14.x versions. I would like to restore the setup
> from the backup file.
>
>
> That looks like a dump file generated by pg_dumpall, so restoring it
> should be as simple as:
>
> psql -f backup-file.sql
>
> You'll possibly need other connection parameters as required by psql,
> such as -U (the PostgreSQL user to use for connecting) or others.
>
> HTH,
>
> Ray.
>
>
> --
> Raymond O'Donnell // Galway // Ireland
> ray(at)rodonnell(dot)ie
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sebastien Flaesch 2022-07-19 16:50:28 Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence
Previous Message Sankar, Uma (Uma) 2022-07-19 16:48:19 Patroni & PostgreSQL issue