Thread: pg_dump cross-version support

pg_dump cross-version support

From
"Alain BAUDHUIN"
Date:
Hello!
 
I need to load a pgsql 8.1 database dump (SQL format) into a pgsql 7.3 server (through phpPgAdmin). This does not work, since many v8 instructions are not recognised by v7.3 (e.g. SET default_table_space, function pg_get_serial_sequence,...) which is not unexpected.
 
I'm surprised, though not to find any pg_dump switch to produce a v7.x compatible dump. Did I look at the wrong place ? Does anybody know about the right way to dump a database in a cross-version compatible form ?
 
Any hint is welcome!
 
A.
 
NB: I expect this issue is fairly common for people who, like me, run their development server on Windows (ie. v 8+) and have their application hosted at a provider who keeps delaying its upgrade from v7 to v8...
 
_____________________
Alain BAUDHUIN
 

Re: pg_dump cross-version support

From
Peter Eisentraut
Date:
Alain BAUDHUIN wrote:
> I'm surprised, though not to find any pg_dump switch to produce a
> v7.x compatible dump. Did I look at the wrong place ? Does anybody
> know about the right way to dump a database in a cross-version
> compatible form ?

Downgrades are generally not supported.  You may be able to convince the
older pg_dump to dump the newer database but I don't expect that to
work very well either.  The best bet is probably to use the new pg_dump
and manually fix up the dump for 7.3.

> NB: I expect this issue is fairly common for people who, like me, run
> their development server on Windows (ie. v 8+) and have their
> application hosted at a provider who keeps delaying its upgrade from
> v7 to v8...

This sort of thing is a recipe for desaster for more reasons than this
one.  Developing on version X gives no guarantees that deploying on
version Y will work.

Btw., speaking of "v7" and "v8" is about as useful and specific as
talking about Linux 1 and Linux 2.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/