1
votes

I have PostGIS 2.0.4 installed with PostgreSQL 9.2.4, trying to enable spatial database extension with the following command:

CREATE EXTENSION postgis;

but encountered an error -

ERROR: must be owner of type spheroid

What is this spheroid type? How could I enable it?

Update:

Well, I still couldn't find a solution so I had to remove everything and reinstall again. Now I am getting a new error saying:

ERROR: could not load library "/usr/pgsql-9.2/lib/rtpostgis-2.0.so": libclntsh.so.11.1 cannot open shared object file: No such file or directory.

I have no luck google out an answer to this. It seems libclntsh.so.11.1 is a Oracle library? Why it has something to do with PostgreSQL?

2
The spheroid type is provided by PostGIS. On what OS? How did you install Postgres/PostGIS?Mike T
I installed postgresql through rpm on RHEL6.2 and postgis was hand built from source. I didn't do much of configuration, just ./configure then make -> make install.Jie Zhang
Hmm, I've built it many times, but I've never seen this error. Take a look at trac.osgeo.org/postgis/wiki/UsersWikiInstall for different methods of building/installing. Also, the PGDG RPMs are pretty good quality.Mike T

2 Answers

2
votes

Try logging in as a db superuser. On Linux the following should work on most distros:

sudo postgres psql [dbname]

Then ownership and permissions can be effectively ignored. In general I would recommend doing this for most extension installations as this usually requires superuser privileges anyway.

1
votes

I know this is an ancient question, but I want an answer here for the next time I run into it!

Drop the tables spatial_ref_sys and geometry_columns. They shouldn't be tables in your schema. In my case, they got created as an artefact of using DotNet to create Entity Framework models from a SQL Server database, then using EF to recreate the DB in Postgres.

So:

sudo postgresql psql [dbname] -c "drop table spatial_ref_sys; drop table geometry_columns; create extension postgis;"