I've imported data from S-57 format into a PostgreSQL/PostGIS database using ogr2ogr (GDAL 2.1.0) and it resulted in several tables; one for each feature type. I intend to merge these tables into a single table.
However, the current primary keys for the tables are ones which I think was introduced by the importer,
ogc_fid, as the values count up from 1 with increments of 1 for each table. That means that the values would not be unique after a merge and can thus not be used as primary key. I intend to drop that column after or before the merge as it doesn't fit my needs.
That leaves three columns which are candidates for being used as primary key, and I'm here to ask which one to pick as I'm not very familiar with the S-57 format.
RCID: This column is not listed here. I've not found information on this column in many places (Googling didn't return many relevant results), though one place referred to it as something like "Record Identification". From what I can see, it contains the same value as FIDN, though I can't say for sure that so is the case for all features.
FIDN: Feature Identification Number. It stands to reason that this one would be unique for each feature, but I'm not so sure. Is it possible that a feature could fall under multiple feature types and thus the same FIDN show up in multiple tables? I'm not familiar enough with S-57 to know.
LNAM: Long Name. It's a combination of AGEN, FIDN and FIDS. So far all features I've seen have had the same values in AGEN and FIDS, so I don't see how this one would be more unique than FIDN if the same FIDN value could appear in multiple tables.
If I stay in doubt I'm probably going to make some combination of FIDN and OBJL into the primary key, because every table have different OBJL values (because it identifies the feature type) and the FIDN should at least be unique within each table.
EDIT: Upon closer inspection I see that the OBJL is already included in the FIDN. So they are already unique between tables.