SmartLogic Logo (443) 451-3001

The SmartLogic Blog

SmartLogic is a web and mobile product development studio based in Baltimore. Contact us for help building your product or visit our website to learn more about what we do.

Installing PostGIS 1.5 on PostgreSQL 8.4 on Ubuntu

March 4th, 2010 by

I had a bit of trouble installing the latest PostGIS 1.5 under PostgreSQL 8.4. Here are my instructions. These work on Ubuntu 8.04, 9.04, 9.10, 10.04, and 10.10.

UPDATE

This post has been updated to include the awesome instructions from Leo regarding using the postgis-unstable ppa. Thanks Leo!

1. Install PostGIS from PPA

System -> Administration -> Software Sources

Click on the “Other Software” tab.

Click on “+Add”

Enter: “ppa:ubuntugis/ubuntugis-unstable”

More info: https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable

Now install the package “postgresql-8.4-postgis”

2. Setup your database

createdb my_db
createlang plpgsql my_db
psql -d my_db -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
psql -d my_db -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql
psql -d my_db -f /usr/share/postgresql/8.4/contrib/postgis_comments.sql

Now you should be able to make a geometry table.

3. Setup your geometry table

At this point I’m showing how to make an example table. Your usage of the PostGIS library will probably differ.

create sequence points_id_seq;
create table points ( id integer primary key default nextval('points_id_seq') );
select AddGeometryColumn('points', 'location', 4326, 'POINT', 2);
create index points_location_idx on points using GIST ( location );

// Create a point
insert into points(location) values (ST_GeomFromText('POINT(-76.615657 39.327052)'));

// Returns the point
select * from points where ST_Distance(location, ST_GeomFromText('POINT(-76 39)')) < 1;

// Does not return the point
select * from points where ST_Distance(location, ST_GeomFromText('POINT(-76 39)')) < .1;
  • termal12

    Hi, I tried to follow your instructions but no luck installing Postgis.

    After I write in the console the command “./configure –prefix=/usr/local
    “I keep getting the same error message.

    Could you help me?

    Thanks in advance.

    checking build system type… i686-pc-linux-gnu
    checking host system type… i686-pc-linux-gnu
    checking for gcc… gcc
    checking for C compiler default output file name… a.out
    checking whether the C compiler works… yes
    checking whether we are cross compiling… no
    checking for suffix of executables…
    checking for suffix of object files… o
    checking whether we are using the GNU C compiler… yes
    checking whether gcc accepts -g… yes
    checking for gcc option to accept ISO C89… none needed
    checking for a sed that does not truncate output… /bin/sed
    checking for grep that handles long lines and -e… /bin/grep
    checking for egrep… /bin/grep -E
    checking for fgrep… /bin/grep -F
    checking for ld used by gcc… /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld… yes
    checking for BSD- or MS-compatible name lister (nm)… /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface… BSD nm
    checking whether ln -s works… yes
    checking the maximum length of command line arguments… 1572864
    checking whether the shell understands some XSI constructs… yes
    checking whether the shell understands “+=”… yes
    checking for /usr/bin/ld option to reload object files… -r
    checking how to recognize dependent libraries… pass_all
    checking for ar… ar
    checking for strip… strip
    checking for ranlib… ranlib
    checking command to parse /usr/bin/nm -B output from gcc object… ok
    checking how to run the C preprocessor… gcc -E
    checking for ANSI C header files… yes
    checking for sys/types.h… yes
    checking for sys/stat.h… yes
    checking for stdlib.h… yes
    checking for string.h… yes
    checking for memory.h… yes
    checking for strings.h… yes
    checking for inttypes.h… yes
    checking for stdint.h… yes
    checking for unistd.h… yes
    checking for dlfcn.h… yes
    checking for objdir… .libs
    checking if gcc supports -fno-rtti -fno-exceptions… no
    checking for gcc option to produce PIC… -fPIC -DPIC
    checking if gcc PIC flag -fPIC -DPIC works… yes
    checking if gcc static flag -static works… yes
    checking if gcc supports -c -o file.o… yes
    checking if gcc supports -c -o file.o… (cached) yes
    checking whether the gcc linker (/usr/bin/ld) supports shared libraries… yes
    checking whether -lc should be explicitly linked in… no
    checking dynamic linker characteristics… GNU/Linux ld.so
    checking how to hardcode library paths into programs… immediate
    checking whether stripping libraries is possible… yes
    checking if libtool supports shared libraries… yes
    checking whether to build shared libraries… yes
    checking whether to build static libraries… yes
    checking for gcc… (cached) gcc
    checking whether we are using the GNU C compiler… (cached) yes
    checking whether gcc accepts -g… (cached) yes
    checking for gcc option to accept ISO C89… (cached) none needed
    checking how to run the C preprocessor… gcc -E
    checking for g++… g++
    checking whether we are using the GNU C++ compiler… yes
    checking whether g++ accepts -g… yes
    checking whether we are using the GNU C++ compiler… (cached) yes
    checking whether g++ accepts -g… (cached) yes
    checking how to run the C++ preprocessor… g++ -E
    checking for ld used by g++… /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld… yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries… yes
    checking for g++ option to produce PIC… -fPIC -DPIC
    checking if g++ PIC flag -fPIC -DPIC works… yes
    checking if g++ static flag -static works… yes
    checking if g++ supports -c -o file.o… yes
    checking if g++ supports -c -o file.o… (cached) yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries… yes
    checking dynamic linker characteristics… GNU/Linux ld.so
    checking how to hardcode library paths into programs… immediate
    checking if g++ supports -Wall… yes
    checking if g++ supports -Wmissing-prototypes… yes
    checking if g++ supports -ffloat-store… yes
    checking for flex… no
    checking for lex… no
    checking for bison… no
    checking for byacc… no
    checking ieeefp.h usability… no
    checking ieeefp.h presence… no
    checking for ieeefp.h… no
    checking for convert… /usr/bin/convert
    checking for xsltproc… /usr/bin/xsltproc
    checking for dblatex… no
    configure: WARNING: dblatex is not installed so PDF documentation cannot be built
    configure: WARNING: could not locate Docbook stylesheets required to build the documentation
    checking CUnit/CUnit.h usability… no
    checking CUnit/CUnit.h presence… no
    checking for CUnit/CUnit.h… no
    configure: WARNING: could not locate CUnit required for liblwgeom unit tests
    checking iconv.h usability… yes
    checking iconv.h presence… yes
    checking for iconv.h… yes
    checking for libiconv_open in -liconv… no
    checking for iconv_open in -lc… yes
    checking for pg_config… no
    configure: error: could not find pg_config within the current path. You may need to try re-running configure with a –with-pgconfig parameter.

  • http://www.smartlogicsolutions.com/nick Nick Gauthier

    Hey Termal12,

    That means that GEOS is not installed. pg_config is a program that is part of the GEOS package, and PostGIS won’t compile without it. Make sure you installed GEOS to /usr/local and that /usr/local/bin is part of your PATH variable (echo $PATH).

    See if you can run pg_config by typing “which pg_config”. It will probably give you an error. Then try “sudo updatedb && mlocate pg_config” to do a search for pg_config to see if it is installed anywhere (should be in /usr/local/bin).

    If you have problems with “sudo checkinstall” you can always do “sudo make install”.

    -Nick

  • Matt

    Hi,

    pg_config is a part of POSTGRESQL (“pg” like *P*ost*G*resql).

    Regards.

  • Hugo

    siguser@sigserver:~$ sudo apt-get install libproj-dev libxml2-dev postgresql-server-dev-8.4
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    libproj-dev is already the newest version.
    libxml2-dev is already the newest version.
    postgresql-server-dev-8.4 is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 232 not upgraded.

    No Problem with:

    ./configure

    Swig: false
    Python: false
    Ruby: false

    Problem with:

    make

    siguser@sigserver:~/geos-3.2.0$ make
    Making all in build
    make[1]: Entering directory `/home/siguser/geos-3.2.0/build’
    Making all in msvc80
    make[2]: Entering directory `/home/siguser/geos-3.2.0/build/msvc80′
    Making all in geos_c_dll
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc80/geos_c_dll’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc80/geos_c_dll’
    Making all in geos_lib
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc80/geos_lib’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc80/geos_lib’
    Making all in geos_python
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc80/geos_python’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc80/geos_python’
    Making all in geos_ruby
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc80/geos_ruby’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc80/geos_ruby’
    Making all in geos_unit
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc80/geos_unit’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc80/geos_unit’
    Making all in geos_xmltester
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc80/geos_xmltester’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc80/geos_xmltester’
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc80′
    make[3]: Nothing to be done for `all-am’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc80′
    make[2]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc80′
    Making all in msvc90
    make[2]: Entering directory `/home/siguser/geos-3.2.0/build/msvc90′
    Making all in geos_c_dll
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc90/geos_c_dll’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc90/geos_c_dll’
    Making all in geos_lib
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc90/geos_lib’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc90/geos_lib’
    Making all in geos_python
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc90/geos_python’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc90/geos_python’
    Making all in geos_ruby
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc90/geos_ruby’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc90/geos_ruby’
    Making all in geos_unit
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc90/geos_unit’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc90/geos_unit’
    Making all in geos_xmltester
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc90/geos_xmltester’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc90/geos_xmltester’
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc90′
    make[3]: Nothing to be done for `all-am’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc90′
    make[2]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc90′
    Making all in msvc10
    make[2]: Entering directory `/home/siguser/geos-3.2.0/build/msvc10′
    Making all in geos_c_dll
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc10/geos_c_dll’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc10/geos_c_dll’
    Making all in geos_lib
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc10/geos_lib’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc10/geos_lib’
    Making all in geos_unit
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc10/geos_unit’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc10/geos_unit’
    Making all in geos_xmltester
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc10/geos_xmltester’
    make[3]: Nothing to be done for `all’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc10/geos_xmltester’
    make[3]: Entering directory `/home/siguser/geos-3.2.0/build/msvc10′
    make[3]: Nothing to be done for `all-am’.
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc10′
    make[2]: Leaving directory `/home/siguser/geos-3.2.0/build/msvc10′
    make[2]: Entering directory `/home/siguser/geos-3.2.0/build’
    make[2]: Nothing to be done for `all-am’.
    make[2]: Leaving directory `/home/siguser/geos-3.2.0/build’
    make[1]: Leaving directory `/home/siguser/geos-3.2.0/build’
    Making all in source
    make[1]: Entering directory `/home/siguser/geos-3.2.0/source’
    Making all in algorithm
    make[2]: Entering directory `/home/siguser/geos-3.2.0/source/algorithm’
    Making all in locate
    make[3]: Entering directory `/home/siguser/geos-3.2.0/source/algorithm/locate’
    make[4]: Entering directory `/home/siguser/geos-3.2.0/source/algorithm/locate’
    source=’IndexedPointInAreaLocator.cpp’ object=’IndexedPointInAreaLocator.lo’ libtool=yes \
    DEPDIR=.deps depmode=none /bin/bash ../../../depcomp \
    /bin/bash ../../../libtool –tag=CXX –mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../source/headers -I../../../source/headers/geos -I../../../source/headers -DGEOS_INLINE -pedantic -Wall -ansi -Wno-long-long -ffloat-store -c -o IndexedPointInAreaLocator.lo IndexedPointInAreaLocator.cpp
    libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../../source/headers -I../../../source/headers/geos -I../../../source/headers -DGEOS_INLINE -pedantic -Wall -ansi -Wno-long-long -ffloat-store -c IndexedPointInAreaLocator.cpp -o .libs/IndexedPointInAreaLocator.o
    ../../../libtool: line 990: g++: command not found
    make[4]: *** [IndexedPointInAreaLocator.lo] Error 1
    make[4]: Leaving directory `/home/siguser/geos-3.2.0/source/algorithm/locate’
    make[3]: *** [all-recursive] Error 1
    make[3]: Leaving directory `/home/siguser/geos-3.2.0/source/algorithm/locate’
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/home/siguser/geos-3.2.0/source/algorithm’
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/siguser/geos-3.2.0/source’
    make: *** [all-recursive] Error 1

  • Nick Gauthier

    @Matt thanks for the tip, hope it helps termal.

    @Hugo:

    apt-get install build-essential

  • Hugo

    hi again,

    already tried,

    sudo apt-get update
    sudo apt-get install build-essential
    sudo apt-get install build-essential –fix-missing

    with sudo apt-get install build-essential i got a message:

    Failed to fetch http://pt.archive.ubuntu.com/ubuntu/pool/main/g/gcc-4.4/gcc-4.4-base_4.4.1-4ubuntu9_i386.deb Size mismatch

    Already tried to use us.archive.ubuntu.com but got same message. Size mismatch…

    Dunno what else i can do to install build-essential.

    Hugo

  • Hugo

    Now i replaced all :

    pt.archive.ubtuntu

    with

    us.archive.ubuntu

    in /etc/apt/sources.list

    and managed to install build-essential !!

  • http://smartlogicsolutions.com/wiki/Nick_Gauthier Nick Gauthier

    @Hugo Cool! Sounds like you’re on your way then. Seems like your packages were a bit messed up.

  • Pingback: Geoserver en entorno de producción (V): Configurando PostgreSQL 8.4 y PostGIS 1.5 | Ni'palante Ni'patras

  • Malek

    Hello,
    Postgresql 8.4 can’t find geometry type with this postgis 1.5 installation, can any help please ?

  • http://smartlogicsolutions.com/nick Nick Gauthier

    @Malek

    Sure I can help you out. What commands did you run to get that error, and can you post the error?

    The best way to post code and output would be to use something like Gist:
    http://gist.github.com/

    Then I can look at it there.

    -Nick

  • http://www.rosslawley.co.uk/ Ross

    @Malek – I had the same thing:

    sudo /sbin/ldconfig

    then restart the postgresql server

  • Cris

    I can’t tell you how helpful this example was…

    I got an SRID error from the addgeometrycolumn creating a constraint, but I figured it out.

    Thanks for the assist.

    I hope Baltimore is treating you well. I used to live right near your work on Westerwald and 33rd. Weird.

    -cris

  • jomunculus

    Cris,

    What was the solution? Thanks.

  • Mark

    Awesome tutorial, thanks! Everything went smooth for me up until I tried to insert a point.

    # INSERT INTO points(location) VALUES (ST_GeomFromText(‘POINT(-76.615657 39.327052)’));
    ERROR: new row for relation “points” violates check constraint “enforce_srid_location”

    Any thoughts?

    Thanks

  • Mark

    I had to modify my insert statement to below to get it working:

    INSERT INTO points(location) VALUES (ST_SetSRID(ST_GeomFromText(‘POINT(-76.615657 39.327052)’),4326));

    Did I miss some configuration along the way that would make 4326 the default rather than -1 ?

    Thank you

  • http://www.smartlogicsolutions.com/nick Nick Gauthier

    SELECT AddGeometryColumn(‘points’, ‘location’, 4326, ‘POINT’, 2);

    should have done it on the column. In Rails with GeoRuby I had to do this:

    module GeoRuby
    module SimpleFeatures
    DEFAULT_SRID=4326
    end
    end

  • Mark

    Thanks Nick. Yeah, I don’t get it..the record exists in my table:

    # select * from geometry_columns;
    f_table_catalog | f_table_schema | f_table_name | f_geometry_column | coord_dimension | srid | type
    —————–+—————-+————–+——————-+—————–+——+——-
    | public | points | location | 2 | 4326 | POINT
    (1 row)

  • Zack Stauber

    Thanks for writing this page. I’m on Ubuntu 10.04 LTS 64-bit desktop and all of this (geos and then postgis) worked once I had apt-get install the basic postgres 8.4. apt-get install couldn’t make the basic postgis 1.4 work with my knowledge level, so I removed that and downloaded postgis 1.5.1 and geos 3.2.2 tar zips, and I never would have gotten it all working without this guide.

  • http://www.energysavvy.com/ Leo

    Instead of doing this manually, I would strongly recommend just using the ubuntugis-unstable repository:

    https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable

    It has backports for all of the packages you need and lays things out in the expected Ubuntu fashion.

  • http://www.smartlogicsolutions.com/nick Nick Gauthier

    @Leo

    Awesome! I didn’t realize there was a PPA for that. I’ll definitely switch over and update the blog post when I get a chance.

    -Nick

  • David Epstein

    Hi,

    Thank you for your directions. I am using Ubuntu 9,04 and postgis 3.3. The upgrade appears to go well until running postgis.sql. I seem to have a path problem. Have you seen this before? $libdir is undefined/empty.

    psql -d postgis3_5 -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
    SET
    BEGIN
    psql:/usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql:59: ERROR: could not access file “$libdir/postgis-1.5″: No such file or directory
    psql:/usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql:65: ERROR: current transaction is aborted, commands ignored until end of transaction block
    psql:/usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql:70: ERROR: current transaction is aborted, commands ignored until end of transaction block
    etc
    etc
    etc

  • Nick Gauthier

    Hey David,

    Did you try Leo’s instructions above? That’s a much better way of doing it than my way. Much simpler and more reliable too.

  • David Epstein

    I’m using Jaunty–and postGIS is not available. I may need to upgrade my OS if I want to use the distributions.

  • Henri de Feraudy

    Hi,
    On my system there’s no such file as
    /usr/share/doc/postgis/doc/postgis_comment.sql
    in fact /usr/share/doc/postgis/doc/ doesnt contain much.

    Is this going to be a big handicap ? The rest worked well.
    Thanks for your article which was tremendously useful to a beginner like me.

    Henri

  • http://smartlogicsolutions.com/wiki/Nick_Gauthier Nick Gauthier

    @Henri

    Sorry about that, that was a bug in my post. I’ve updated it to the proper path, which is:

    /usr/share/postgresql/8.4/contrib/postgis_comments.sql

    -Nick

  • Pingback: Setting up PostGIS on Ubuntu Server

  • http://www.lozzal.com Cam Turner

    Thanks! You saved me lots of time!

  • Carlos Cerdán

    Hi Nick:
    Thank you very much for your post,it was useful for me. I have Ubuntu 11.04 – Postgre8.4 and PostGIS 1.5, and I made step 2 partial because my systmen doesn’t have the postgis_comments.sql file, but now I can import shape files into PostgreSQL with QGIS (via SPIT extension), so What is postgis_comments.sql file for?

    Regards from Cajamarca – Perú

    Carlos

  • Carlos Cerdán

    I found the answer: http://postgis.refractions.net/docs/ch02.html#PGInstall , that file is for… doing comments.

  • Josip

    I had the same problem of those PostGIS .sql files missing, MY SOLUTION:

    sudo apt-get install postgresql-contrib

    That is, my whole /contrib directory was missing, and this was why. When I installed postgresql-contrib and the PostGIS, everything was OK.

  • Pingback: Instalar PostGis en PostgreSQL | cutnpaste.org

  • Sam

    Hi.

    I run this:

    . . . . . . . . . . . . . .
    postgres=# SELECT NOW();
    now
    ——————————-
    2011-10-01 14:13:30.189673-05
    (1 row)
    . . . . . . . . . . . . . .

    OK !!

    Then I Run:

    . . . . . . . . . . . . . .
    -bash-3.2$ createlang plpgsql geoespacial
    Password:
    createlang: language “plpgsql” is already installed in database “geoespacial”
    -bash-3.2$
    . . . . . . . . . . . . . .

    Then: Guao!!!… LANGUAGE EXIST !!!

    Then I run:

    . . . . . . . . . . . . . .
    postgres=# SELECT PostGIS_Full_Version();
    ERROR: function postgis_full_version() does not exist
    LINE 1: SELECT PostGIS_Full_Version();
    ^
    HINT: No function matches the given name and argument types. You might need to add explicit type casts.
    postgres=#
    . . . . . . . . . . . . . .

    WHAT I can do please ???

    If I run (newly):
    psql -d geoespacial -f /usr/share/pgsql/contrib/postgis-1.5/postgis.sql
    psql -d geoespacial -f /usr/share/pgsql/contrib/postgis-1.5/spatial_ref_sys.sql

    result is:

    psql:/usr/share/pgsql/contrib/postgis-1.5/postgis.sql:7085: ERROR: current transaction is aborted, commands ignored until end of transaction block
    psql:/usr/share/pgsql/contrib/postgis-1.5/postgis.sql:7091: ERROR: current transaction is aborted, commands ignored until end of transaction block

    PLEASE HELP

    THANKS