[Geoserver-users] postgis wfs insert problem

Hi,
I am new to geoserver. I have set up a WFS-T using geoserver 1.6 with PostGIS as the data store. I have a simple table in the database:
dummy
{
col1 text;
col2 text;
}

When I execute the following WFS request:

<wfs:Transaction service=“WFS” version=“1.0.0”
xmlns:wfs=“http://www.opengis.net/wfs
xmlns:snet=“http://www.snet.org
xmlns:gml=“http://www.opengis.net/gml
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” >
wfs:Insert
snet:dummy
snet:col1text1</snet:col1>
snet:col2text2</snet:col2>
</snet:dummy>
</wfs:Insert>
</wfs:Transaction>

I get the following error:




{http://www.snet.org}dummy is read-only

I have checked the privileges on the table dummy. I have granted full priveleges (arwdxt) on the table to public user. How do I get it to work? Thanks.

Upendra

Dadi, Upendra ha scritto:

Hi,
  I am new to geoserver. I have set up a WFS-T using geoserver 1.6 with PostGIS as the data store. I have a simple table in the database:
   dummy
    {
      col1 text;
      col2 text;
    }

...

I have checked the privileges on the table dummy. I have granted full priveleges (arwdxt) on the table to public user. How do I get it to work? Thanks.

By adding a primary key. The WFS standard requires us to return the
generated feature id back, that cannot be done with a table without
a primary key. Create your table like this:

create table dummy (id serial, text1 text, text2 text),

Cheers
Andrea