Problem:
I have a workbench that reads data from a geopackage and writes this to a postgis table. The workbench simply reads data and writes the data with only one attribute. The primary key, called 'fid', should be generated by postgis and not FME so I do not provide a primary key in FME.
This postgis table has a column called 'fid' which is the primary and has a not null constraint. It creates the primary by auto incrementing using 'nextval('mytable_fid_seq'::regclass)'.
- The workbench used to work, and has stopped working suddenly
- other similar workbenches still work on other databases
An (unwanted) solution
The only solution that works is to add an SQL Executor before writing the data. However this slows down the progress a lot. The statement is: 'select nextval('treetops_py_fid_seq') as fid'. I'd rather have a different solution.
Adding a counter that generates numbers and write these as 'fid' works, until it finds a situation where the generated number already exists in the table.
Tried so far
I have tried giving a 'fid' attribute in the user attributes with manual settings. This did not work.
Restarting FME or creating a new workbench does not work.
error message
Bulk copy failed on table 'public.mytable' using delimiter ':'. Error was 'ERROR: null value in column "fid" violates not-null constraint
DETAIL: Failing row contains (null, 01010000204071000000000000098D044100000080724C1D41, txt...'
A fatal error has occurred. Check the logfile above for details
... Last line repeated 2 times ...
Bulk copy failed on table 'public.mytable' using delimiter ':'. Error was 'no COPY in progress
'
A fatal error has occurred. Check the logfile above for details
... Last line repeated 2 times ...