Skip to main content
Solved

Error when attempting to write to existing PostGres Table

  • January 26, 2021
  • 1 reply
  • 60 views

Hi,

I attempting to write to an existing table which contains polygons based in Postgres database. I have selected truncate existing table.

 

I get following error:

Error was 'ERROR: null value in column "objectid" violates not-null constraint

 

The object ID seems to be an issue only when attempting remove existing data and add new data. When creating a new table, this is not a issue.

 

Best answer by tomf

It sounds like the Postgresql table has a non-null constraint on the objectid field (There's no ESRI SDE sitting on top of this DB is there?). You will have to ensure that all features you write contain a value for objectid (or edit the table definition to remove the constraint). Also, check your writer feature type parameters don't assign an index to objectid.

Creating a new table won't automatically have this constraint, so you don't run into this issue.

View original
Did this help you find an answer to your question?

1 reply

tomf
Contributor
Forum|alt.badge.img+14
  • Contributor
  • Best Answer
  • January 28, 2021

It sounds like the Postgresql table has a non-null constraint on the objectid field (There's no ESRI SDE sitting on top of this DB is there?). You will have to ensure that all features you write contain a value for objectid (or edit the table definition to remove the constraint). Also, check your writer feature type parameters don't assign an index to objectid.

Creating a new table won't automatically have this constraint, so you don't run into this issue.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings