Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

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

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.