Hello,

Le samedi 28 février 2015, 04:43:53 Régis Haubourg a écrit :
> Hi,
> well pgadmin sets table view in readonly mode if no Primary Key is defined..
> That is more than a good practice from a DBA point of view, I wouldn't be
> against such a constraint for tables. We should raise some user warning
> when connecting to PG, so that users don't get confuzed
> Another point, what about views that do not have PK (but may be editable) ?

If you talk about auto-updateable views, you can track back the original table 
and check it for PK, as the PostgreSQL doc says :
"The view must have exactly one entry in its FROM list, which must be a table 
or another updatable view."
There could still be a problem though if the PK from the original table is not 
selected in the view. This could be checked too.

More generally, it would be great to be able to override this behaviour if the 
user provides a unique and not null column name.
There are cases when triggers, rules and other mechanisms would require this 
and are not easily automatically detectable.

Vincent


> Cheers
> Régis
> 
> 
> 
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Strange-behaviour-in-feature-ids-when-e
> diting-PostGIS-layer-tp5185929p5190614.html Sent from the Quantum GIS -
> Developer mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer

-- 
Vincent Picavet - Gérant Oslandia
www.oslandia.com
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to