[fdo-users] PostGIS and Map 3D 2010 autoincrement problems

Mike Toews mwtoews at sfu.ca
Mon Jun 22 19:52:45 EDT 2009


David,

Yikes. I've been demoing Map3D 2010 for the past few weeks to see if we 
want to upgrade from 2008, and I can reproduce the same behavior you 
describe in 2010. This behavior is new to me, since it is not an issue 
with 2008 (the serial appears as 0 in the table, as you described, until 
it is checked-in and refreshed).

To add details, the error response from 2010 when trying to check-in a 
new feature:

<Error code="200" type="5" dispensation="3" sId="2" 
occurrence="1">Feature was not saved in the target feature 
source.<Parameters>
<Parameter classId="0" position="0">
<Message>2=Invalid property value name 'gid'.
</Message>
<SQL></SQL>
</Parameter>
<Parameter classId="0" position="0">
<Message>1=Failed to execute Fdo command.
</Message>
<SQL></SQL>
</Parameter>
<Parameter classId="0" position="0">
<Message>Failed to insert feature.</Message>
<SQL></SQL>
</Parameter>
<Parameter classId="0" position="0">
<Message>FdoPostGIS:mytable (), Rev# &lt;0&gt;</Message>
<SQL></SQL>
</Parameter></Parameters>
<Entry code="1" type="15" sId="3" occurrence="1">Failed to save some 
features.</Entry>
<Entry code="1" type="15" sId="4" occurrence="1">Failed to save edit 
set.</Entry>
</Error>

In QGIS and other programs, the default value for a serial (integer) 
that is shown in the property before insert/commit is 
"nextval('mytable_gid_seq'::regclass)", which might explain the error 
message "Invalid property value name 'gid'", since it appears as a 
string, not an integer in this form.

I tried fixing this with some trigger functions within the database, but 
whatever I've tried I can't seem to make a workaround. The best I can do 
is raise some exception in a before trigger, which shows up in the error 
message in AutoCAD, but making a trigger that sets "NEW.gid := 
nextval('mytable_gid_seq'::regclass);" still throws the error shown above.

Is this an issue with FDO or with AutoCAD Map3D 2010?

-Mike

David Anderson wrote:
>
> I have been trying to setup Map 3D 2010 to access a PostGIS database 
> that has a feature set to auto increment the primary key. When trying 
> to create a new feature, Map 3D complains about the gid being invalid 
> because it tries to add it as 0. Map 3D won’t let me change the value 
> because it is controlling it. If I check in the feature, close the 
> drawing, reopen the drawing Map 3D shows the feature even though it 
> was saying it couldn’t be added. I have tried with various 
> combinations of PostgreSQL 8.2 & 8.3 and PostGIS 1.3.4-1.3.6 with the 
> same results.
>
> Is anybody successfully using Map 3D with the auto increment setting? 
> Does this only work with a certain data type? Any help would be 
> greatly appreciated.
>
> QGIS and uDig both access the database properly and can add features 
> so the database is working in that respect.
>
> Thanks,
>
> David
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> fdo-users mailing list
> fdo-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>   



More information about the fdo-users mailing list