Thread: pg_dump on Linux with pg_restore on Windows?

pg_dump on Linux with pg_restore on Windows?

From
David Wall
Date:
I know this used to be a problem, but I don't have a Windows server to
test it on again.

Can I do a pg_dump on Linux and then pg_restore it on Windows?  We're
using PG 8.3 now, but could certainly upgrade if that made the difference.

Thanks,
David


Re: pg_dump on Linux with pg_restore on Windows?

From
David Wall
Date:
> I know this used to be a problem, but I don't have a Windows server to
> test it on again.
>
> Can I do a pg_dump on Linux and then pg_restore it on Windows?  We're
> using PG 8.3 now, but could certainly upgrade if that made the
> difference.

Okay, maybe I answered my own question, though if anybody has experience
one way or another, I'd love to hear it.  It looks like the pg_dump
option -Fp (or perhaps just no -F option at all) on Linux would write
the backup in script format, so it may allow it to be processed by psql
on the Windows.

If anybody has done this, let me know since I'd hate to have someone
order a new server only to find out we can't get it to work.

Thanks again,
David

Re: pg_dump on Linux with pg_restore on Windows?

From
Raymond O'Donnell
Date:
On 03/11/2009 22:07, David Wall wrote:
> I know this used to be a problem, but I don't have a Windows server to
> test it on again.
>
> Can I do a pg_dump on Linux and then pg_restore it on Windows?  We're
> using PG 8.3 now, but could certainly upgrade if that made the difference.

This should be no problem at all, provided only that the version of
pg_dump used for the restore >= the version used for the dump.... This
is assuming too that you're dumping in the plain-text format; I've never
used the binary dumps so can't comment on that situation.


Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

Re: pg_dump on Linux with pg_restore on Windows?

From
Craig Ringer
Date:
David Wall wrote:
> I know this used to be a problem, but I don't have a Windows server to
> test it on again.
>
> Can I do a pg_dump on Linux and then pg_restore it on Windows?  We're
> using PG 8.3 now, but could certainly upgrade if that made the difference.

Yes.

I regularly do dumps on Linux ( using pg_dump -Fc usually ) and restore
on Windows. It largely makes no difference; it's the same as a restore
on Linux.

PL languages and contrib modules can be an issue, as on Linux. Just like
when restoring to a Linux server you have to make sure the PL languages
used by the database you're restoring are available, though on Windows
this often involves installing the language runtime (
Perl/python/whatever ) rather than the Pg PL module. Similarly, contrib
modules used on the original server need to be available on the target
server. If those requirements are satisfied the restore is easy and smooth.

If you don't use any contrib modules and don't use any PLs other than
PL/PgSQL then it's as utterly fuss free as a restore on another Linux
server.

--
Craig Ringer