pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedErrors recovering database
3+ messages / 2 participants
[nested] [flat]
* Errors recovering database
@ 2011-09-21 11:52 Henrique Teófilo <henriquetft@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Henrique Teófilo @ 2011-09-21 11:52 UTC (permalink / raw)
To: pgsql-admin
Hello,
I'm having issues restoring a dumped database with the following commands:
Dumping:
pg_dump -p -U'postgres' -C -f ./dumpbkp mydatabase
tar -cvzf dumpbkp.tar.gz dumpbkp
Restoring:
cat dumpbkp.tar.gz | gunzip | psql -U'postgres'
The database is quite big, so it takes a lot of time to restore. The process
outputs some normal messages and, in the end, after a lot of time, it prints
out some strangers errors like "duplicate key", "constraint already exists",
and other similar...
at the end, I've got a database 10 GB smaller than the original, which
clearly indicates that some data was lost.
The versions are 8.4.5 (original) and 8.4.7 (restored).
What should I do? Am I doing something wrong?
Thanks in advance.
Henrique Teófilo
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Errors recovering database
@ 2011-09-21 14:35 Tom Lane <tgl@sss.pgh.pa.us>
parent: Henrique Teófilo <henriquetft@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2011-09-21 14:35 UTC (permalink / raw)
To: Henrique Teófilo <henriquetft@gmail.com>; +Cc: pgsql-admin
=?ISO-8859-1?Q?Henrique_Te=F3filo?= <henriquetft@gmail.com> writes:
> Dumping:
> pg_dump -p -U'postgres' -C -f ./dumpbkp mydatabase
> tar -cvzf dumpbkp.tar.gz dumpbkp
> Restoring:
> cat dumpbkp.tar.gz | gunzip | psql -U'postgres'
AFAICS that ought not work at all, not even a little bit. You've
wrapped the dump script into a tar archive, and then not unwrapped it.
The pg_dump argument list seems a bit less than kosher, as well ...
doesn't -p require an argument?
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Errors recovering database
@ 2011-09-21 16:17 Henrique Teófilo <henriquetft@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Henrique Teófilo @ 2011-09-21 16:17 UTC (permalink / raw)
To: pgsql-admin
Hi Tom.
Actually the -p paremeter has the argument, but I think I've removed it to
clarify the command, because it comes from a variable $pgport in my script.
Concerning to tar command, I think you're right, I didn't notice... but it
did work great until pop up these erros in the end, so I've googled and I've
seen other people with the same problem, what led me to think it was a
postgres error.
I'll try again unwrapping the file properly
Thanks.
On Wed, Sep 21, 2011 at 11:35 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> =?ISO-8859-1?Q?Henrique_Te=F3filo?= <henriquetft@gmail.com> writes:
> > Dumping:
> > pg_dump -p -U'postgres' -C -f ./dumpbkp mydatabase
> > tar -cvzf dumpbkp.tar.gz dumpbkp
>
> > Restoring:
> > cat dumpbkp.tar.gz | gunzip | psql -U'postgres'
>
> AFAICS that ought not work at all, not even a little bit. You've
> wrapped the dump script into a tar archive, and then not unwrapped it.
>
> The pg_dump argument list seems a bit less than kosher, as well ...
> doesn't -p require an argument?
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2011-09-21 16:17 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-09-21 11:52 Errors recovering database Henrique Teófilo <henriquetft@gmail.com>
2011-09-21 14:35 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-09-21 16:17 ` Henrique Teófilo <henriquetft@gmail.com>
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