Re: Dump large DB and restore it after all.

From: Christian Ullrich <chris(at)chrullrich(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Dump large DB and restore it after all.
Date: 2011-07-05 09:46:35
Message-ID: iuumhr$i26$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

* Condor wrote:

> Problem was when I start: pg_dump dbname | split -b 1G - filenameI
> unable to restore it correct. When I start restore DB i got error from
> sql he did not like one line. I make investigation and the problem was
> in last line of first file value field was something like '"This is a '
> and here file over. I added single quotes in the example that I can pay
> the phrase to make it clear what I mean. In next file sentence was end
> correct 'simple test"' (also without single quotes) and this was not

psql does not know that you split the file. You must send the whole dump
to psql at once, not piece by piece.

Instead of

psql dbname < filename.1
psql dbname < filename.2

do this:

cat filename.1 filename.2 | psql dbname

--
Christian

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2011-07-05 10:08:21 Re: Dump large DB and restore it after all.
Previous Message Gavin Flower 2011-07-05 09:45:44 Re: Finding latest record for a number of groups in an INSERT-only table