I created a simple table in my Postgres\PostGIS DB. I then created the GeoServer layer with the SQL:

select * from tablename

I'm trying a WFS Transaction, like I usually do (and it works on similar tables!) to add data to that layer. I get this error:

{http://myorganization.org}layername is read-only

It's a common error, that's usually due to the lack of a primary key in the "tablename" table. But the table has a primary key!

create table tablename(
serialID serial PRIMARY KEY,
field1 text,
field2 text,
field3 text,
field4 timestamp without time zone,
geom geometry

I already have other tables where the Transaction works in the same GeoServer instance, so it's not a system wide option or lack of permission to the tomcat user. How do I fix this error?

  • 1
    can you explain why you used a view which doesn't modify the table, just publishing a layer based on the table is easier – Ian Turton May 3 '16 at 14:31
  • That was my mistake. I have always only used SQL Views and thought that was the way to do it. Thank you. – user3804769 May 3 '16 at 14:42
  • Could you please elaborate on your mistake? @iant I'm having the same problem and I'm not sure what's the solution – Luffydude Jun 1 '16 at 15:14

Layers published as sql views are not editable, you have to publish them as normal tables instead

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.