ERROR: could not access file “$libdir/postgis-2.0”

2019-07-27 11:05发布

问题:

I am running postgresapp 9.2.4.3 and postgis and trying to add a geometry column to a table. The postgis extension is running.

When I run:

SELECT AddGeometryColumn('public'::varchar,'gloutline'::varchar,'geom'::varchar,'4326','MULTIPOLY ON','2');

I'm getting the following errors:

ERROR:  could not access file "$libdir/postgis-2.0": No such file or directory
LINE 1: ALTER TABLE public.gloutline ADD COLUMN geom geometry(MultiP...
QUERY:  ALTER TABLE public.gloutline ADD COLUMN geom geometry(MultiPolygon, 4326)
CONTEXT:  PL/pgSQL function addgeometrycolumn(character varying,character varying,character varying,character varying,integer,character varying,integer,boolean) line 110 at EXECUTE statement
SQL statement "SELECT AddGeometryColumn('',$1,$2,$3,$4,$5,$6,$7)" PL/pgSQL function addgeometrycolumn(character varying,character varying,character varying,integer,character varying,integer,boolean) line 5 at SQL statement

回答1:

A reinstall of postgress.app including the application support files fixed the problem.