[postgis-tickets] [PostGIS] #3495: AddGeometryColumn relies on table being in search_path

PostGIS trac at osgeo.org
Tue Mar 8 08:49:52 PST 2016


#3495: AddGeometryColumn relies on table being in search_path
---------------------+---------------------------
 Reporter:  robe     |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  blocker  |  Milestone:  PostGIS 2.2.2
Component:  postgis  |    Version:  2.2.x
 Keywords:           |
---------------------+---------------------------
 Okay discovered an isssue with my search_path setting logic.
 The way our AddGeometryColumn works.  The version that doesn't take schema
 requires the table with geometry column being added has schema set.

 I discovered this issue with


 {{{
 CREATE SCHEMA postgis VERSION "2.3.0dev";
 CREATE EXTENSION postgis SCHEMA postgis;
 ALTER DATABASE workshop_1
   SET search_path = public, postgis;

 -- and then using shp2pgsql to restore
 shp2pgsql -I -D -s 26986 data/MBTA_ARC mbta_lines | psql

 }}}


 {{{
 ALTER TABLE
 ERROR:  Table 'mbta_lines' does not occur in the search_path
 CONTEXT:  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
 ERROR:  current transaction is aborted, commands ignored until end of
 transaction block
 invalid command \.
 ERROR:  syntax error at or near "GREEN"
 LINE 1: GREEN C D 7 4.58386095740e+002 01050000206A69000001000000010...
         ^
 ROLLBACK
 ERROR:  relation "mbta_lines" does not exist

 }}}


 So I guess we've got to exclude all these from my search_path logic I put
 in on #3490. Eventually I think we'll need to force everyone to install
 postgis in same schema and schema qualify at least these ones and
 relationship ones that rely on users schema to be in search path to work
 well.

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3495>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list