[postgis-users] is update privilige related to select?

Chander Ganesan chander at otg-nc.com
Mon Nov 5 05:39:26 PST 2007


Milo van der Linden wrote:
> Hello list,
>
> I have a construction where a central table is updated based upon user 
> action in a specific user table.
>
> When the user updates a record in his own table, a trigger is fired 
> that updated the central table with an insert .... where ogc_fid = x 
> statement.
I think you should look at the SECURITY DEFINER settings for Stored 
Procedures and triggers.  You can create the trigger so it runs with 
permissions that differ from the user that is updating the table.  Thus 
the trigger would have rights on the table being selected and updated, 
but the user would not have those rights.

http://www.postgresql.org/docs/techdocs.77

Keep in mind that when using these settings you need to make sure that 
you are careful as to how you define the triggers/procedures.  Make sure 
they either set their own search path, or that they specify a schema 
when using or referencing objects.

Chander
>
> I keep getting a "permission denied" error, even tough I granted the 
> user INSERT and UPDATE priviliges. Is it because the user has no 
> SELECT rights that the insert where fails? I don't want to give the 
> user select rights, because this would make my entire construction 
> useless!
>
> Any idea is appreciated!
> -- 
>
>
> 	
>
> Milo van der Linden
> skype: milovanderlinden <skype:milovanderlinden?add>
> mlinden at zeelandnet.nl <mailto:mlinden at zeelandnet.nl>
> milovanderlinden at gmail.com <mailto:milovanderlinden at gmail.com>
> milo at 3dsite.nl <mailto:milo at 3dsite.nl>
> http://www.3dsite.nl
>
> 	  	
>
> De informatie in dit bericht reflecteert mijn persoonlijke mening en 
> niet die van een bedrijf of instantie. Aan de informatie kunnen geen 
> rechten worden ontleend. Indien dit bericht onderdeel is van een 
> forum, mailing-list of community dan gelden automatisch de bij het 
> betreffende medium behorende voorwaarden. The information in this 
> message reflects my personal opinion and not that of a company or 
> public body. All rights reserved.If this message is contained in a 
> mailing-list or community, the rights on the medium are automatically 
> adapted.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>   


-- 
Chander Ganesan
Open Technology Group, Inc.
One Copley Parkway, Suite 210
Morrisville, NC  27560
919-463-0999/877-258-8987
http://www.otg-nc.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20071105/13dc4f4e/attachment.html>


More information about the postgis-users mailing list