I am trying to copy data from a PostgreSQL (9.4) DB table to an SDE table. Both have an objectid field. If I copy the data from the source table with the OID field, I get an error because the values in OID in the destination table have duplicates. If I copy the data without the OID field, I get an error for not respecting the not null constraint on the destination OID.
I tried to remove the primary key constraint and the not null constraint on the OID with an alter table and even if through PGadmin I can see that there is no pkey constraint, as I run my script, I still get the error saying that the not null constraint can't be removed because objectid is in a primary key.
I would like to avoid reassigning a new OID to the entries with a cursor in the source table, as there is a lot of them. Is there any way I could bypass those constraints?