[postgis-devel] Issue 72 in postgis: ST_Estimated_Extent sometimes returns null if table exists but not in current schema

codesite-noreply at google.com codesite-noreply at google.com
Mon Nov 24 11:25:23 PST 2008


Comment #3 on issue 72 by ke... at refractions.net: ST_Estimated_Extent  
sometimes returns null if table exists but not in current schema
http://code.google.com/p/postgis/issues/detail?id=72

I would advise using pg_catalog.pg_table_is_visible(oid) rather than  
current_schema()
to determine which schema a table is located in.  I agree that the problem  
here is
that current_schema only returns the first entry in the search_path.  It  
looks like
we have the same problem with addgeometrycolumns and most like, other  
functions that
use the current_schema().

IE.
postgis=# CREATE TABLE tmp2.foo();

postgis=# SET search_path to tmp, tmp2, public;

postgis=# SELECT n.nspname AS schemaname
postgis-# FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON  
n.oid =
c.relnamespace
postgis-# WHERE c.relkind IN ('r','')
postgis-# AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
postgis-# AND pg_catalog.pg_table_is_visible(c.oid)
postgis-# AND c.relname = 'foo';
  schemaname
------------
  tmp2
(1 row)



-- 
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings



More information about the postgis-devel mailing list