[postgis-devel] estimated_extent & pg_statistic

Martin Schäfer Martin.Schaefer at cadcorp.com
Fri Feb 24 02:16:08 PST 2006


Hi Mark,
 
It works fine with your changed code.
However, only the 3-argument version of estimated_extent() will work. The 2-argument version still fails with the same error. So I guess the 'SECURITY DEFINER' keywords should be added for each version of estimated_extent().
 
Thanks for the fix.
 
Martin

________________________________

From: postgis-devel-bounces at postgis.refractions.net on behalf of Mark Cave-Ayland
Sent: Fri 24/02/2006 10:33
To: 'PostGIS Development Discussion'
Subject: RE: [postgis-devel] estimated_extent & pg_statistic




> From: postgis-devel-bounces at postgis.refractions.net
[mailto:postgis-devel-bounces at postgis.refractions.net] On Behalf Of Martin
Schäfer
> Sent: 24 February 2006 09:17
> To: PostGIS Development Discussion
> Subject: RE: [postgis-devel] estimated_extent & pg_statistic
>      
>      
>       How do I have to change lwpostgis.sql  to test this?
>       
>       Martin


Hi Martin,

Quite easily. Take the definition of estimated_extent() from lwpostgis.sql
(the version below is from PostGIS 1.1.1) and add SECURITY DEFINER onto the
end, e.g.


CREATE OR REPLACE FUNCTION estimated_extent(text,text,text) RETURNS box2d AS
        '$libdir/liblwgeom.dll', 'LWGEOM_estimated_extent'
        LANGUAGE 'C' IMMUTABLE STRICT; -- WITH (isstrict);

To:

CREATE OR REPLACE FUNCTION estimated_extent(text,text,text) RETURNS box2d AS
        '$libdir/liblwgeom.dll', 'LWGEOM_estimated_extent'
        LANGUAGE 'C' IMMUTABLE STRICT SECURITY DEFINER; -- WITH (isstrict);


Then all you need to do is execute the new CREATE OR REPLACE statement as
your database superuser and then see if normal users can use the
estimated_extent() function.


Kind regards,

Mark.

------------------------
WebBased Ltd
17 Research Way
Plymouth
PL6 8BT

T: +44 (0)1752 797131
F: +44 (0)1752 791023

http://www.webbased.co.uk <http://www.webbased.co.uk/>  
http://www.infomapper.com <http://www.infomapper.com/>
http://www.swtc.co.uk <http://www.swtc.co.uk/> 

This email and any attachments are confidential to the intended recipient
and may also be privileged. If you are not the intended recipient please
delete it from your system and notify the sender. You should not copy it or
use it for any purpose nor disclose or distribute its contents to any other
person.


_______________________________________________
postgis-devel mailing list
postgis-devel at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-devel



-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 6428 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20060224/bc413491/attachment.bin>


More information about the postgis-devel mailing list