[postgis-tickets] [PostGIS] #3615: ST_CreateOverview conflict on cast to regclass for duplicate table name
PostGIS
trac at osgeo.org
Tue Aug 30 08:20:31 PDT 2016
#3615: ST_CreateOverview conflict on cast to regclass for duplicate table name
-----------------------+---------------------------
Reporter: hypostase | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.3.0
Component: postgis | Version: 2.2.x
Keywords: |
-----------------------+---------------------------
I have a series of tables with the same names but in different schemata.
When I create an overview using the r_table_schema.r_table_name syntax, I
receive the following error
PL/pgSQL function st_createoverview(regclass,name,integer,text) line 49 at
PERFORM
ERROR: relation "o_2_gb_stsu_u_rp75_rd_5m_27700" does not exist
CONTEXT: PL/pgSQL function st_createoverview(regclass,name,integer,text)
while casting return value to function's return type
The schema in question in not in the search path.
When the search path is changed to include the path in the first position,
the function works correctly
ST_CreateOverview returns regclass
CREATE OR REPLACE FUNCTION ST_CreateOverview(tab regclass, col name,
factor int, algo text DEFAULT 'NearestNeighbour')
RETURNS regclass AS $$
but the value returned is the overview table name (autocast to regclass)
which appears to conflict in the namespace.
(where ttab is)
ttab := 'o_' || factor || '_' || sinfo.tab;
RETURN ttab;
I suspect that this should be
RETURN sinfo.sch ||'.'|| ttab;
or similar, to ensure that the same table is being returned as has been
created, when the schema is specified
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3615>
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