[postgis-devel] estimated_extent & pg_statistic

Mark Cave-Ayland m.cave-ayland at webbased.co.uk
Fri Feb 24 01:33:12 PST 2006


> 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.





More information about the postgis-devel mailing list