* Magnus Warker tat kund und zu wissen:
I make backups like this:
pg_dump -a -w mydb > mydb.sql
That’s a data only dump, i.e. you have to connect to a database contaong
the empty database tables etc. of mydb.
Why do you not create a full database dump?
Well, this doesn't create SQL statements, but statements like this:
COPY table1 (atr1,atr2,atr3) FROM stdin;
val1 val2 val3
val1 val2 val3
val1 val2 val3
It’s valid SQL for a postgresql database. And as you only requested the
data, you get only the data …
However, when I use cat mydb.sql | psql mydb, I get a lot of errors,
because it's no real SQL in the file...
How can I restore my dump?
Connect to a database containing the empty database schema of mydb:
$ psql -X mydb_new < mydb.sql
Or just create a full database dump and restore into a completly empty
new database:
$ pg_dump mydb > mydb.sql
$ psql -X mydb_new < mydb.sql
Regards,
Harald
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)