Happened when i tried to add some points to a layer (containing
POIs) loaded from a postgis database. I fired up eclipse enabled
trancing and this is what i got :
ENTRY net.refractions.udig.tools.edit 1 0 2011-09-14 01:23:46.953
!MESSAGE
!STACK 0
java.io.IOException: Error inserting features
[ ..].
*Caused by: org.postgresql.util.PSQLException: ERROR: insert or update
on table "poi" violates foreign key constraint "poi_id_cat_fkey"*
Detail: Key (id_cat)=(0) is not present in table "poi_categ".
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:345)
at
org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
at
org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
at org.geotools.jdbc.JDBCDataStore.insert(JDBCDataStore.java:1366)
... 50 more
Now programatically this could be settled with an input box asking for
an FK value that respects the constraints on that att, but i'm curious
why this hasn't been implemented in udig(is there maybe an even easier
solution which i'm missing? maybe an option which i did not activate?)
And... why does each postgis layer have two renderers? (in layer view
they appear only once)
Current Renderers:
CompositeRendererImpl
RenderExecutorImpl:BasicWMTRenderer-Mapnik
MapGraphicRenderer
RenderExecutorImpl:BasicFeatureRenderer-poi_categ
RenderExecutorImpl:BasicFeatureRenderer-poi
RenderExecutorImpl:BasicFeatureRenderer-poi_categ
RenderExecutorImpl:BasicFeatureRenderer-poi
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel