I am using Postgres 9.3 and PostGIS 2.1, installed in a Docker container via

RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get -y install postgresql-9.3 postgresql-contrib-9.3 postgresql-9.3-postgis-2.1 postgis

According to the docs I can spatial-enable my database just by executing these commands against my db in a psql console:

CREATE EXTENSION postgis_topology;

It then says:

If you plan to restore an old backup from prior versions in this new db, run:

psql -d [yourdatabase] -f legacy.sql

Well, I need to import data dumped from Postgres 9.1 and PostGIS 1.5.3 so I guess I need to do this (I have tried not doing it and I get errors when creating a table with a geography column)

I don't know where to find "legacy.sql" though.

I downloaded http://www.postgis.org/download/postgis-2.0.2.tar.gz and found a "legacy.sql" in there but I get errors when I run it:

psql:/common/postgres_data/legacy.sql:11: 00-regress-install/share/contrib/postgis/legacy.sql: No such file or directory
(followed by lots more errors)

Looking at the source I think it's trying to include another file also called "legacy.sql" but I can't find it.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.