With FME I read a table that has an id
column with pre-existing values, like
id | some_attributes...
--------------------------------
56784645 | ...
56478687 | ...
...
I would like to write these into a PostgreSQL/PostGIS database and for further data input I define the id
column as serial / PrimaryKey. Because of joins to other tables, the id
values need to be preserved.
In the resulting table my id
values are replaced by the serials:
id | some_attributes...
--------------------------------
1 | ...
2 | ...
...
QUESTION: How can I set up FME PostGIS writer in a way that defines a column as serial, but preserves my pre-existing values for this column?
SERIAL
'data type' cannot simply continue existing ids and will always restart with 1 when initialized. on DB level you could thenALTER SEQUENCE <seq_name> RESTART WITH <min_val>
, given that your ids are in order and gap-less. if that is not suitable...I fear that having another dedicated primary key column will be among the few options here.(serial, id)
or(id, serial)
columns...with different effects on index performance. does your id represent row count?