[GIS] How to edit a layer in GeoServer, when we change table schema in a database (SQL Server)

geoserversql server

So, is there a way to change/edit SQL Server layer definition in GeoServer, when a table schema has been changed in a database? Or you have to delete that layer and then build a new one?

Best Answer

On The Geoserver Layer Page, there is the option at the bottom of the page

Reload feature type ...

Bear in mind if you change any of your existing columns, any SLD may need to be changed.

If it is just adding additional columns, should be no need to recreate the layer

EDIT:

To handle different schema's, use the PostGres Schema Search Path

SET search_path TO old_schema, new_schema, public;

Create new tables in new_schema then just switch the search order around:

SET search_path TO new_schema, old_schema, public;

Most likely, you will need to reload the feature types in Geoserver as described above to pick up any new columns.

If you want to use schema names, then Geoserver will see schema1.mytable and schema2.mytable as completely different tables

Related Question