Can't create features when attribute rules are enabled!

576
5
Jump to solution
01-09-2023 11:28 AM
pocalipse
New Contributor III

Hi

I have a very strange exception in my very simple C# code. I'm trying to insert polygon features in a feature class and everything is working perfectly until I create an attribute rules calling a sequence on a field on creation.

What is really strange is the exception since I get an ArcGIS.Core.Data.Exceptions.GeodatabaseEnterpriseException

'A database level I/O error occurred. Reason: Underlying DBMS error [ERROR: Geometry type (MultiPolygon) does not match column type (Polygon) (s100ed6.s101.geoms)::SQLSTATE=22023]'

If I disable the attribute rule everything is working again.

Creating features directly in ArcGIS PRO works perfectly and the sequence is updating the field as expected.

I would really appreciate any feedback on this topic 🙂

 

Best regards
Jens

 

0 Kudos
1 Solution

Accepted Solutions
pocalipse
New Contributor III

Hi Rich

I'm sorry for my very late reply!

Anyway, my problem is related to the fact that I keen to create my tables and feature classes directly in Postgres and then just use the RegisterTable functionality in ArcGIS PRO. If you do so the attribute rules will fail but if you start from scratch creating your tables and feature classes directly in ArcGIS PRO everything is working.

So everything is actually working but now I'm stuck with an ObjectID attribute and a SHAPE attribute and the idea was to use some other naming specially on the SHAPE field and that is why I started directly in the database.

--Jens 

View solution in original post

0 Kudos
5 Replies
RichRuh
Esri Regular Contributor

Hi Jens,

What kind of database are you using? Are you editing in a CoreHost app or a Pro add-in?

Thanks,

--Rich

0 Kudos
pocalipse
New Contributor III

Hi Rich

I'm currently working in a Postgres enterprise database and the code is a CoreHost application. 

My very small code is actually only copying features from another database to this Postgres one and everything is working perfectly - until I enable an attribute rule on one of my fields!

Best regards
Jens

0 Kudos
RichRuh
Esri Regular Contributor

If you can post your editing code fragment here, I can see if anything looks weird, but we haven't seen anything like this before, and you may need to submit this to technical support for further analysis.

Sorry I'm not much help.

--Rich

0 Kudos
pocalipse
New Contributor III

Hi Rich

I'm sorry for my very late reply!

Anyway, my problem is related to the fact that I keen to create my tables and feature classes directly in Postgres and then just use the RegisterTable functionality in ArcGIS PRO. If you do so the attribute rules will fail but if you start from scratch creating your tables and feature classes directly in ArcGIS PRO everything is working.

So everything is actually working but now I'm stuck with an ObjectID attribute and a SHAPE attribute and the idea was to use some other naming specially on the SHAPE field and that is why I started directly in the database.

--Jens 

0 Kudos
RichRuh
Esri Regular Contributor

Hi Jens,

Thanks for letting me know- that's interesting information. We can take a look and see if this is something we can support in the future. For now, your work-around is probably the best solution.

--Rich

0 Kudos