[postgis-users] Updating PostGIS views from Geoserver
lr at pcorp.us
Wed Feb 18 00:19:36 PST 2009
Actually Paul answered my question so yes it does seem to be a limitation of
geoserver. I do have the primary key field in my view and can edit it fine
by doing updates and so forth.
I think there is a way to set the target select and update differently in
geoserver so investigating that.
I was hoping I could trick Postgres into allowing me to add a select rule on
a table if I didn't put in a primary key and then adding a primary key after
the fact. No such luck. When you do that it converts the table into a
view. Kind of bizarre.
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Andreas
Sent: Wednesday, February 18, 2009 2:31 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Updating PostGIS views from Geoserver
I am pretty sure it is a restriction by Geoserver, but I am not a Geoserver
user, so I may be wrong. I am using updateable views with Postgis and QGIS
and it works fine, as long as it finds a primary key (integer and unique).
Did you make sure that you have a "primary key" in your view?
It may be that Geoserver:
- is not accepting views for inserts/updates/deletes at all
- is not seeing/accepting the rules
- does not find a primary key but requires one
I know other software that is not accepting views for updates/inserts
although the rules are present (e.g. pgadmin3)
Updateable views are very cool - I also use them to distribute to different
tables and for historization purposes.
Paragon Corporation wrote:
> I'm not sure if this is the best list to try, but hoping someone may
> have a solution to this and since I'm not on the geoserver list,
> figured I would try this one first.
> In one of the projects we have, we have a PostgreSQL view with
> update, insert, select rules on it. I am told that geoserver sees
> this as a read-only table since it can't see the indexes on it.
> Is this a limitation of Geoserver and if so is there a workaround
> around this?
> The main reason we need the view is that we are trying to retrieve
> information and update a field in another table from data
> inserted/updated in the view so need these virtual fields to be present.
> I played around with the idea of creating a real table that mirrors
> the structure of the view and putting an instead of select rule on the
> table, but I guess this is not legal if a table has indexes which
> would seem to defeat the purpose since it would make the table equally
> unattractive to geoserver.
> postgis-users mailing list
> postgis-users at postgis.refractions.net
postgis-users mailing list
postgis-users at postgis.refractions.net
More information about the postgis-users