Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

RUN echo "deb 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 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.

share|improve this question
I found this question… but there are no .sql files in my /usr/share/postgresql/9.3/contrib/postgis-2.1/ dir, only a single file – Anentropic Dec 27 '13 at 10:59

Your Answer


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

Browse other questions tagged or ask your own question.