Solved

Error when attempting to write to existing PostGres Table

  • 26 January 2021
  • 1 reply
  • 11 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.

 

icon

Best answer by tomf 28 January 2021, 06:08

View original

1 reply

Badge +7

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.

Reply