![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello all, i would like to restore a backup make in plain text format but i'm not able to do it. when i give the command: pg_restore -i -h 192.168.50.3 -p 5432 -U root -d db -l --format=c "pgsql.sql" it answer me that he can't find the magic string... how can i solve? i can't re-make the backup now ![]() thanx in advance Dade |
#3
| |||
| |||
|
|
"Dade" <cucca77NOSPAM (AT) gmail (DOT) com> ha scritto nel messaggio news:463f39b2 (AT) newsgate (DOT) x-privat.org... pg_restore -i -h 192.168.50.3 -p 5432 -U root -d db -l --format=c ^^^^^^^^^^ it answer me that he can't find the magic string... how can i solve? i can't re-make the backup now ![]() [snip] I forgot to say that the backup has been made in plain text in a postgresql ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 8.2.4... maybe the 2 versions are not compatibles? |
#4
| |||
| |||
|
|
"Dade" <cucca77NOSPAM (AT) gmail (DOT) com> ha scritto nel messaggio news:463f39b2 (AT) newsgate (DOT) x-privat.org... Hello all, I forgot to say that the backup has been made in plain text in a postgresql 8.2.4... maybe the 2 versions are not compatibles? for now this doesnt't matter: |
|
i would like to restore a backup make in plain text format but i'm not able to do it. when i give the command: pg_restore -i -h 192.168.50.3 -p 5432 -U root -d db -l --format=c "pgsql.sql" it answer me that he can't find the magic string... how can i solve? i can't re-make the backup now ![]() |
#5
| |||
| |||
|
|
Dade wrote: "Dade" <cucca77NOSPAM (AT) gmail (DOT) com> ha scritto nel messaggio news:463f39b2 (AT) newsgate (DOT) x-privat.org... Hello all, I forgot to say that the backup has been made in plain text in a postgresql 8.2.4... maybe the 2 versions are not compatibles? for now this doesnt't matter: i would like to restore a backup make in plain text format but i'm not able to do it. when i give the command: pg_restore -i -h 192.168.50.3 -p 5432 -U root -d db -l --format=c "pgsql.sql" it answer me that he can't find the magic string... how can i solve? i can't re-make the backup now ![]() format=c specifies "custom" format, not plaintext :-) pg_restore raises error, becuse obviously your backup is not in "custom" format. you shall feed this plaintext backup to postgres as text commands - by smething like "psql --file=pgsql.sql" for example. |
#6
| |||
| |||
|
|
i would like to restore a backup make in plain text format but i'm not able to do it. when i give the command: pg_restore -i -h 192.168.50.3 -p 5432 -U root -d db -l --format=c "pgsql.sql" it answer me that he can't find the magic string... how can i solve? i can't re-make the backup now ![]() format=c specifies "custom" format, not plaintext :-) pg_restore raises error, becuse obviously your backup is not in "custom" format. you shall feed this plaintext backup to postgres as text commands - by smething like "psql --file=pgsql.sql" for example. I've tryed but this give me errors in a lot of commands... |
#7
| |||
| |||
|
#8
| |||
| |||
|
|
Today i tryed with the pgAdmi III 1.6.3 to backup a database, create a new one in the same server and restore it in the new db... I get a lot of errors: pg_restore: connecting to database for restore pg_restore: [archiver (db)] Error while INITIALIZING: pg_restore: [archiver (db)] could not execute query: ERROR: parameter "standard_conforming_strings" cannot be changed Command was: SET standard_conforming_strings = off; pg_restore: [archiver (db)] could not execute query: ERROR: language "plpgsql" already exists Command was: CREATE PROCEDURAL LANGUAGE plpgsql; pg_restore: [archiver (db)] Error from TOC entry 1206; 1259 16385 SEQUENCE banks_id_seq postgres pg_restore: [archiver (db)] could not execute query: ERROR: la relazione "banks_id_seq" esiste già (trad: the sequence allready exist) Command was: CREATE SEQUENCE banks_id_seq INCREMENT BY 1 NO MAXVALUE NO MINVALUE CACHE 1; and the others are for the sequence... This means that i can't backup a db and replicate it in an other server??? |
|
How should i do it in *safe* mode? |
#9
| ||||
| ||||
|
|
Dade <cucca77NOSPAM (AT) gmail (DOT) com> wrote: [CUT] This means that i can't backup a db and replicate it in an other server??? No, that means that you restored to the wrong database :^) First: what version of PostgreSQL do you restore to? The command "SET standard_conforming_strings = off;" should work on any 8.2 database. |
|
pg_restore could not restore the sequence because it already existed. Makes sense, doesn't it? Did you by mistake try to restore into the original database? Here's how you do it (assuming that the cluster is on the default port on localhost, else you'll have to season with a couple of -h and -p): Make a dump of database "orig": pg_dump -F c -U postgres -f orig.dmp orig Connect to the "postgres" database and create a new database "dbcopy": psql -U postgres -d postgres -c 'CREATE DATABASE dbcopy TEMPLATE template0' Restore the dump into the new database: pg_restore -d dbcopy -U postgres orig.dmp |

|
How should i do it in *safe* mode? Hmm? Whaddayamean? You have made backups, no? |

|
Yours, Laurenz Albe |
![]() |
| Thread Tools | |
| Display Modes | |
| |