pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Restore to a new database from a backup (.tar) generated from
2+ messages / 2 participants
[nested] [flat]

* Restore to a new database from a backup (.tar) generated from
@ 2023-11-29 22:18  PG Doc comments form <noreply@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Doc comments form @ 2023-11-29 22:18 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: rhudon@numetrix.ca

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/15/app-pgrestore.html
Description:

After creating a new database in postgreSQL :                              
CREATE DATABASE x;
I dump it in a .tar file:                                                   
                    pg_dump -p 5433 -U postgres -W -F t x > 
C:\pgBackups\x.tar
Then I restore it with  the restore command:                                
   pg_restore -p 5433 -U postgres -W -d x -C --verbose C:\pgBackups\x.tar
                   RESULT : pg_restore: création de DATABASE « x »
                                    pg_restore: pendant le traitement de la
TOC (« PROCESSING TOC ») :
                                    pg_restore: de l'entrée TOC 3315 ; 1262
29865 DATABASE x postgres
                                    pg_restore: erreur : could not execute
query: ERREUR:  la base de données « x » existe déjà
                                    La commande était : CREATE DATABASE x
WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE_PROVIDER = libc LOCALE =
'French_Canada.1252';
                                    pg_restore: connexion à la nouvelle base
de données « x »
                                    pg_restore: attention : erreurs ignorées
lors de la restauration : 1                     ' PROBLEM WITH CODE PAGE
1252 and the fact that the (empty) db already exists
if I remove the database (x) from PostgreSQL (Version 15.5)            DROP
DATABASE x;
and I try the same restore command:                                         
          pg_restore -p 5433 -U postgres -W -d x -C --verbose
C:\pgBackups\x.tar
                  RESULT :  pg_restore: connexion à la base de données pour
la restauration
Mot de passe :
pg_restore: erreur : la connexion au serveur sur « localhost » (::1), port
5433 a échoué : FATAL:  la base de données « x » n'existe pas     ' The
problem is that the database does not exist  

So, I can I create a database from scratch, in PostgreSQL, from a backup
(.tar) file generated from  pg_dump ?


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Restore to a new database from a backup (.tar) generated from
@ 2023-12-01 13:58  Daniel Gustafsson <daniel@yesql.se>
  parent: PG Doc comments form <noreply@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Daniel Gustafsson @ 2023-12-01 13:58 UTC (permalink / raw)
  To: rhudon@numetrix.ca; pgsql-docs@lists.postgresql.org

> On 29 Nov 2023, at 23:18, PG Doc comments form <noreply@postgresql.org> wrote:
> 
> The following documentation comment has been logged on the website:
> 
> Page: https://www.postgresql.org/docs/15/app-pgrestore.html
> Description:
> 
> After creating a new database in postgreSQL :                              

This form is not intended to be used for general questions about postgres,
please use the appropriate mailinglist for this.  In your case I would
recomment pgsql-general.

	https://www.postgresql.org/list/

--
Daniel Gustafsson






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2023-12-01 13:58 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-11-29 22:18 Restore to a new database from a backup (.tar) generated from PG Doc comments form <noreply@postgresql.org>
2023-12-01 13:58 ` Daniel Gustafsson <daniel@yesql.se>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox