[Qgis-user] postgis layer cannot edit anymore after adding version in PostGIS Manager

Martin Dobias wonder.sk at gmail.com
Fri Feb 12 03:38:22 PST 2010


On Fri, Feb 12, 2010 at 9:49 AM, maning sambale
<emmanuel.sambale at gmail.com> wrote:
>
> I tried adding an area column and used the the Data Processing to
> compute for the area.  Next, I used the versioning table which added
> additional columns id_hist, time_start, time_end
>
> Now when I tried editing the postgis layer, I cannot save my edits.
> An error report says:
>
> ERROR:  invalid input syntax for integer: "197461.982774913"
> CONTEXT:  PL/pgSQL function "parcel_stat_calc_area" line 3 at assignment
>
>
> Any idea how to solve this?  Totally a newbie with postgis (liking it so far).

Looks like you've set the trigger function for automatic area
calculation to a field with integer type. The returned area is a
double precision number and PostgreSQL obviously doesn't want to cast
it automatically to int.

For an easy solution I would recommend you to change the column from
'int' to 'double precision' type. Just to get rid of the error, you
can delete the trigger function "parcel_stat_calc_area" in postgis
manager - but the areas won't get updated.

Anyway, if there's anyone more PostgreSQL savvy than me, he/she could
advise how tell PostgreSQL to play nicely also with int type, i.e. how
to modify this line:
NEW.id_water := area(NEW.the_geom);


> Another question, I saw this video:
> http://www.youtube.com/watch?v=2ShYUU-e4JM
>
> Showing postgis/geoserver edit versioning with history, rollback, etc.
>  Are there plans for a similar QGIS plugin?

I'm not aware of such a plugin (or plans to make it), but definitely
it would be handy.

Martin



More information about the Qgis-user mailing list