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?

Mnementh
  • 1,075
  • 2
  • 11
  • 18

1 Answers1

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...

Jan Marek
  • 2,120
  • 1
  • 13
  • 14
  • There is a third: convert postgresql database to access using odbc, and then convert to postgresql – Alan Kuras Jun 22 '12 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 '12 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 '12 at 16:44