[postgis-users] estimated_extent does not work

Jose Carlos Martinez jomarlla at cgf.upv.es
Sun Sep 17 17:14:39 PDT 2006


Hi list,

I have a problem with the function estimated_extent,
it only works if the actual user is the owner and has superuser permissions,
but it does not work if the actual user is other superuser that the
table owner.

is it normal? I think any superuser should be able to run this
function...am I right?

Thanks,

test1=# select estimated_extent ('suelos','geom');
ERROR:  permission denied for relation pg_statistic
CONTEXT:  SQL statement "SELECT s.stanumbers1[5:8] FROM pg_statistic s,
pg_class c, pg_attribute a, pg_namespace n WHERE c.relname = 'suelos'
AND a.attrelid = c.oid AND a.attname = 'geom' AND n.nspname =
current_schema() AND c.relnamespace = n.oid AND s.starelid=c.oid AND
s.staattnum = a.attnum AND staattnum = attnum"
test1=#

test1=# SELECT session_user, has_table_privilege((SELECT usesysid FROM
pg_user WHERE usename = session_user), 'suelos', 'select');
 session_user | has_table_privilege
--------------+---------------------
 postgres     | t
(1 row)

test1=# SELECT s.stanumbers1[5:8] FROM pg_statistic s, pg_class c,
pg_attribute a, pg_namespace n WHERE c.relname = 'suelos' AND a.attrelid
= c.oid AND a.attname = 'geom' AND n.nspname = current_schema() AND
c.relnamespace = n.oid AND s.starelid=c.oid AND s.staattnum = a.attnum
AND staattnum = attnum;
            stanumbers1
-----------------------------------
 {4008.98,4577.15,6141.98,7376.99}
(1 row)







More information about the postgis-users mailing list