Restore backup in Plain Fomate

Asked

Viewed 74 times

-1

How to restore a Postgresql backup in format Plain ??

The server is Windows.

I already tried in SQL Shell, but it seems that you can’t find the file.

banco=# < C:\pasta_do_arquivo\bkp_plain.backup Erro: Comando invalido \pasta_do_arquivo.

  • https://answall.com/a/250305/69359 here’s a similar question you can use. Note. -1 is not mine, but you can improve your question.

  • I always use custom and tar formats, but I got a backup and found that it was done in Plain format, and I didn’t get it right. Until the Store in pgAdmin does not have this format but in the backup yes.

  • is the simplest: https://stackoverflow.com/questions/2732474/restore-a-postgres-backup-file-using-the-command-line / https://www.postgresql.org/docs/9.1/backup.html

1 answer

0

To restore with Plain format, from what I understand, it needs to be by SQL Shell(psql).

1) Enter with the user [postgres] and in the bank [postgres]

2) Create bank to be restored:

create database testes;

3) Connect to the bank to be restored:

\c 'dbname=testes user=postgres'

4) Start restore indicating the backup location:

\i 'c:\\pasta_bkps\\testes.backup'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.