[postgis-tickets] [PostGIS] #3076: Unqualified function calls break postgres_fdw compatibiliy

PostGIS trac at osgeo.org
Wed Mar 11 19:04:08 PDT 2015


#3076: Unqualified function calls break postgres_fdw compatibiliy
----------------------+-----------------------------------------------------
 Reporter:  fphilipe  |       Owner:  pramsey
     Type:  defect    |      Status:  new    
 Priority:  medium    |   Milestone:         
Component:  postgis   |     Version:  2.1.x  
 Keywords:            |  
----------------------+-----------------------------------------------------
 I'm using postgres_fdw to access a database that has postgis installed.
 The problem is that the session that postgres_fdw opens only has
 `pg_catalog` in its `search_path`.

 Let's call the DB being accessed by the foreign data wrapper (FDW) db1 and
 the DB hosting the FDW db2.

 I have a view in db1 that calculates a distance between to geography
 points. In db2 I have a foreign table that reads from that view.
 Unfortunately the call to `st_distance` inside the FDW session fails
 because st_distance calls a private function `_st_distance` without
 explicitly specifying the schema.

 Attached is a minimal script that reproduces this bug. Altering the
 function `st_distance` such that the schema postgis is installed in is in
 its search path fixes the problem. Unfortunately this is not always a
 feasible option.

 Version details:

 PostgreSQL: PostgreSQL 9.4.0 on x86_64-apple-darwin14.0.0, compiled by
 Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn), 64-bit
 PostGIS: POSTGIS="2.1.5 r13152" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel.
 4.8.0, 6 March 2012" GDAL="GDAL 1.11.1, released 2014/09/24"
 LIBXML="2.9.2" LIBJSON="UNKNOWN" RASTER

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/3076>
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