Select to view content in your preferred language

ROWID can not be inserted due to duplicate

108
0
11-25-2024 07:50 PM
yockee
by
Frequent Contributor

I have these error and I am willing to fix it by setting the rowid value to its maximum+1. These errors happen when I try to add an attachment photo as attachment:

  Error: Underlying DBMS error [ERROR: duplicate key value violates unique constraint "r83_sde_rowid_uk" DETAIL: Key (attachmentid)=(801) already exists. (akt_survey.akt_gis.sur_property__attach)::SQLSTATE=23505] [Survey_Property__ATTACH].

 Error: Underlying DBMS error [ERROR: duplicate key value violates unique constraint "r83_sde_rowid_uk" DETAIL: Key (attachmentid)=(1201) already exists. (akt_survey.akt_gis.sur_property__attach)::SQLSTATE=23505] [Survey_Property__ATTACH].
  
Error: Underlying DBMS error [ERROR: duplicate key value violates unique constraint "r83_sde_rowid_uk" DETAIL: Key (attachmentid)=(1202) already exists. (akt_survey.akt_gis.sur_property__attach)::SQLSTATE=23505] [Survey_Property__ATTACH]
 
what happened before was:
1. I have polygon that already contains attachment, namely OLDPOLY
2. Convert these polygon into point using Feature to Point. I name this FC as NEWPOINT
3. Enable attachment on this NEWPOINT
4. Load all attachment using sql query from OLDPOLY to NEWPOINT: Insert Into NEWPOINT select * from OLDPOLY
5. Publish this NEWPOINT as feature service and create apps using FieldMap
6. Begin updating data. I take a new picture and try to upload it. Then those errors come up.
 
I do a query "select max(attachmentid) from sur_property__attach"It says 300800. 
 
It seems that the sequence needs to be moved to the maximum value of current attachmentid (300800) + 1.
How can I solve this problem ? How to find that "r83_sde_rowid_uk" ?
 
i am using Postgresql geodatabase
0 Kudos
0 Replies