Re: Is it possible to "pip" pg_dump output into new db ?

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Frank Foerster <fr667766(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Is it possible to "pip" pg_dump output into new db ?
Date: 2014-03-25 15:46:18
Message-ID: 5331A4CA.3060807@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 25/03/2014 13:56, Frank Foerster wrote:
>
> Hi,
>
> we are currently in the process of upgrading a production/live 1 TB
> database from 9.2 to 9.3 via pg_dump, which is quite a lengthy process.
>
> Fortunately we have a capable spare-server so we can restore into a
> clean, freshly setup machine.
>
> I just wondered wether the intermediate step of writing the dump-file
> and re-reading it to have it written to the database is really
> necessary. Is there any way to "pipe" the dump-file directly into the
> new database-process or would such functionality make sense ?

Surely:

pg_dump [...etc...] | psql [...etc...]

Though I'm sure it will still take a long time for a database of that size.

Another option to explore would be to use Slony, which can replicate
databases between different Postgres versions - one of its design
use-cases is to perform upgrades like this with a minimum of down-time.
You can replicate the database over to the new server, and then
switching need take only seconds once the new one is ready.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-03-25 15:50:21 Re: Failure upgrading PG 9.2 to 9.3
Previous Message Adrian Klaver 2014-03-25 15:01:24 Re: Upgrading from 9.2 to 9.3 causes performance degradation