Ha yes, I was about to say the same. Also see the documentation page about it: https://docs.geoserver.org/stable/en/user/data/database/primarykey.html
Cheers Andrea On Thu, Feb 4, 2021 at 12:40 PM Stefan Overkamp <overk...@posteo.de> wrote: > Some hints to make an updateable view editable, partly in german: > > - create a table [schema].gt_pk_metadata > - configure in geoserver datastore [schema].gt_pk_metadata as Primary > key metadata table > - add in [schema].gt_pk_metadata a primary key column and pk_sequence: > > INSERT INTO myschema.gt_pk_metadata(table_schema, table_name, pk_column, > pk_column_idx, pk_policy, pk_sequence) > VALUES ('myschema', 'layername', 'id', null, 'sequence', > 'myschema.layername_id_seq') > > > - der Layer unter Datensicherheit Schreibrechte für die Rolle aufweisen > - die Rolle als Servicezugriffsregeln WFS-T-Rechte aufweisen > - Wird eines davon erst nach Laden des Layers in QGIS geändert, sollte > die Geoserver-Konfiguration, der FeatureType und der Layer in QGIS neu > geladen werden. > - Wenn der WFS-Layer auf einem SQL-View in Geoserver basiert, ist er > read-only. > > > Stefan > > Am 04.02.2021 um 06:55 schrieb Michael Steigemann via Geoserver-users: > > Good Morning! > > From the documentation > https://docs.geoserver.org/stable/en/user/data/database/sqlview.html it > is obvious that a layer based on a SQL-View is read only. > > Therefore I created an editable view directly in Postgres and registered > it as a normal layer in Geoserver. Unfortunately I still get the following > error message: > > 2021-02-04 06:43:50,104 ERROR [geoserver.ows] - > org.geoserver.wfs.WFSTransactionException: {mist}update_my_media_objects > is read-only > at org.geoserver.wfs.Transaction.execute(Transaction.java:241) > at org.geoserver.wfs.Transaction.transaction(Transaction.java:93) > at > org.geoserver.wfs.DefaultWebFeatureService.transaction(DefaultWebFeatureService.java:147) > > Is there any workaround? I want to achieve that a user can only edit his > own records in GeoServer. Therefore I filter in the view for the logged in > user: > > create or replace view update_my_media_objects as select * from > media_objects where owner_uid = current_setting('current.user', TRUE); > > Thanks and all the best, > Michael > > > _______________________________________________ > Geoserver-users mailing list > > Please make sure you read the following two resources before posting to this > list: > - Earning your support instead of buying it, but Ian Turton: > http://www.ianturton.com/talks/foss4g.html#/ > - The GeoServer user list posting guidelines: > http://geoserver.org/comm/userlist-guidelines.html > > If you want to request a feature or an improvement, also see this: > https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer > > Geoserver-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/geoserver-users > > > > -- > Dipl. Ing. Stefan Overkamp > Laakmannsbusch 44, 42555 Velbert > tel.: 0177 / 79 76 159overk...@posteo.de > > _______________________________________________ > Geoserver-users mailing list > > Please make sure you read the following two resources before posting to > this list: > - Earning your support instead of buying it, but Ian Turton: > http://www.ianturton.com/talks/foss4g.html#/ > - The GeoServer user list posting guidelines: > http://geoserver.org/comm/userlist-guidelines.html > > If you want to request a feature or an improvement, also see this: > https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer > > > Geoserver-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geoserver-users > -- Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- *Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.*
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users