<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yui_3_16_0_ym19_1_1489759182156_29316">Hi All,<br></div><div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1489759182156_29320" style="display: block;"><div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 13px;" id="yui_3_16_0_ym19_1_1489759182156_29319"><div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1489759182156_29318"><div class="y_msg_container" id="yui_3_16_0_ym19_1_1489759182156_29364"><div id="yiv2679321439"><div class="yiv2679321439yqt9334696176" id="yiv2679321439yqtfd31802"><div id="yui_3_16_0_ym19_1_1489759182156_29372"><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;" id="yui_3_16_0_ym19_1_1489759182156_29371"><div class="yiv2679321439qtdSeparateBR"><br></div><div class="yiv2679321439yahoo_quoted" id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_6242" style="display:block;"><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_6241" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_6240" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"><div class="yiv2679321439y_msg_container" id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_6247"><div id="yiv2679321439"><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_6246"><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_6245" style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3959">I created a "Read-only" User in PostgreSQL via a Role with "SELECT" ONLY privilege on all tables in a schema as shown below:</div><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3960"><br clear="none" id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3961"></div><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3962">GRANT SELECT ON ALL TABLES IN SCHEMA [schema_name] TO [role_name]</div><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3963">GRANT [role_name] TO [user_name]</div><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3964"><br clear="none" id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3965"></div><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3966">Next, I test this by trying to UPDATE a column in a table (same schema as above) with pgAdmin/psql and this works fine by giving a response that the user has no permission - 'ERROR: permission denied for relation <table_name>.'</div><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3967"><br clear="none" id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3968"></div><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3969">Next, I connect with the same user in QGIS and add a layer from the same table (same schema as above). I open the attribute table for the layer, turn on editing mode (by clicking on the pencil-like icon), and edit the same field/column above. To my surprise, the edit was saved successfully without any permission error prompt.</div><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3970"><br clear="none" id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3971"></div><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3972">Next, I check the value of the field/column (same table/schema as above) in pgAdmin/psql and it is having the new (edited) value from QGIS. This is rather strange as it seems QGIS is bypassing the permissions set for the same user in the PostgreSQL/PostGIS database.</div><div id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3973"><br clear="none" id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3974"></div><div dir="ltr" id="yiv2679321439yui_3_16_0_ym19_1_1489759182156_3975">I will be glad if someone can help me unravel this mystery.</div></div></div></div><br clear="none"><br></div></div></div></div></div></div></div></div></div> </div> </div>  </div></div></body></html>