Re: restore question

From: Ronald Haynes <rhaynes74(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org, Ray O'Donnell <ray(at)rodonnell(dot)ie>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Subject: Re: restore question
Date: 2022-07-19 17:22:30
Message-ID: eacb1026-d906-48f3-88f6-d7e742aa38c5@Spark
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Many thanks folks, the last message by Adrian gave me the relatively simple prescription.

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, 2:22 PM -0230, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, wrote:
> On 7/19/22 9:44 AM, Ronald Haynes wrote:
> > Thanks Ray, running
> >
> > pSql -f backup-file.sql
> >
> >
> >
> > psql: error: FATAL: database "rhaynes74" does not exist
>
> No that is expected as you did not specify a database to connect to
> using -d <some_db>. In that case psql uses the OS user name you are
> running the command as for the database name per:
>
> https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
>
> dbname
>
> The database name. Defaults to be the same as the user name. In
> certain contexts, the value is checked for extended formats; see Section
> 34.1.1 for more details on those.
>
> So change the command to:
>
> psql -d postgres -U <db_user> -f backup-file.sql
>
> Where <db_user> is a database user that has the correct privileges to
> load/create the databases.
>
> >
> > 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
>
>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Achilleas Mantzios 2022-07-19 17:26:24 Re: pgsql 10.19 : "ERROR: cannot convert infinity to numeric" except there is no infinity
Previous Message Imre Samu 2022-07-19 17:19:54 Re: postgis