I created a WMS layer from a PostGIS table with a fraction of total polygons in GeoServer. Everything displayed fine.

Then, I added the rest of the polygons to the table in postgis. For some reason its not updating the layer. I tried restarting geoserver and its still not updating. How do I get geoserver to update the layer?

I use Open layers WMS layer and OpenLayers.Protocol.WFS.fromWMSLayer(polygons) to get polygon data.

-N

UPDATE: I tried to click Compute from data/Compute from bounding box links to get the new MBR. Unfortunately, it did not update, so here's as much info as I can think to provide.

I have a set of polygons scattered around the US. They are from a pair of SHP files in WGS_1984. I started testing the system with a small set of 100 polygons and now that the system works, I wanted to add the the other polygons to the data. I used shp2sql to create a new table in postgis. Then I used a INSERT INTO polygons (SELECT from ...) to add them to the table that geoserver uses. Now there is about 50k polygons in the table.

I tried updating the MBR as answers below suggest. Here are the current settings of the layer in geoserver:

Native SRS: EPSG:4326
Declared SRS: EPSG:900913

When I hit Compute from data for Native bounding box it gives me:

(Min x,Min y, Max x, Max y)

-10Mil, 5Mil, -10mil, 5Mil

and for the Declared:

-95.xxx,40.xxx,-95.xxx,43.xxx

For whatever reason, they are now updating correctly. The MBR should cover most of the US now and not just that little portion in the middle.

Thanks for pointing me there. For some reason I don't think its updating correctly. I updated my question with more details. For some reason the BB are not being updated correctly
–
NateNov 18 '11 at 19:01

The easiest way to achieve that is erasing the geoserver cache manually. You can find the cache location at the file geoserver-directory/WEB-INF/web.xml, there is a variable called GEOSERVER_DATA_DIR, if its not present you can add it and specify the location of the cache directory (mine is /geosrverdata):

For some reason neither the layer nor the data store updated when I would add data. The layer did not see the new polygons I added. The data store did not see new tables when I added them either.

So I had to create a new PostGIS data store and used the same table to create a new layer. That updated the data, but it would be nice to have the option to update the layer without having to create a new one.

Geoserver automatically copies your datatable from your database into "geoserver." Live updates should be done to that table, not your original. The advantage here is that it helps you host both development data and production data side by side.

I am not sure what you are trying to say here. What do you mean when you say that 'Geoserver automatically copies your datatable from your database into "geoserver."'? Could you clarify this statement?
–
Devdatta TengsheJan 27 '13 at 15:02

I'm running OpenGeo 3. When I load a table into PostGIS under the database for my user ID and then using the Geoserver console to load the layer from the PostGIS store Geoserver copies the table from the database under my user ID into the database named "geoserver." When I update the one under my user ID (bshender in my case) the update is not shown in geoserver automatically. I'd have to manually add it again. But, if I run an insert statement on the copied table under the "geoserver" database the updated data is immediately served by Geoserver via WFS to my OpenLayers page.
–
bshenderJan 28 '13 at 16:33