7

We have a postgres-databse under windows, that is version 9.1. From that we want to dump the data and import under a Linux-server, that runs Postgres 8.4. The data include spatial data with Postgis.

The problem is, that the dump doesn't import, as it uses commands like 'CREATE EXTENSION ..' that can't be understand on the older Postgres. Is there a way to transfer the data between these databases?

1 Answer 1

3

You have two choices:

1) Install on Linux Postgresql v9.1

2) Remove from dump every command, which Postgresql v8.4 doesn't know.

EDIT:

You can do two exports - first only structure of database (pg_dump -s) and then only data (pg_dump -a). Then you can edit only one file...

3
  • There is a third: convert postgresql database to access using odbc, and then convert to postgresql
    – Alan
    Jun 22, 2012 at 11:21
  • I think, that will not work. Normal way is dump on one server, then import on another server. But there is problem with new commands in the export...
    – Jan Marek
    Jun 22, 2012 at 11:27
  • @AlanKuras I'm not sure access can handle the geospatial (GIS) data. It's also likely to be a longer process that way, and there's nothing anywhere in the Postgres documentation about cloning a database this way. (If you're going to do something unsupported like trying to downgrade your database you don't want to mix in other unsupported things)
    – voretaq7
    Jun 22, 2012 at 16:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .