Skip to main content

I'm going from ESRI Shape Files to PostGIS and trying to add a primary key to all my tables so that Mapserver and other queries are happier with the unique Primary Key. I see from https://knowledge.safe.com/idea/74374/postgres-writer-add-unique-primary-option-for-inde.html that I can add a Serial and that works well but I'd like to add that to 20, 30, or even 50 shape files at a time. Is it possible to do this as a batch?

Thanks!

@andrewteg I'm not sure if you're asking if you can create a primary key or type serial: yes you can, Use Data type: Serial and Index: Primary Key

Or if you're asking about a dynamic workspace - see this recent post: https://knowledge.safe.com/questions/104765/append-multiple-esri-geodatabases-into-one.html?childToView=104770#answer-104770 File Geodb, but same steps.

For a dynamic workflow, you can append the shape files to the same PostGIS table or have separate tables for each Shape file.

But... if you want to add an attribute to a dynamic workflow, then add an attribute to the writer feature type, then that attribute will get added to all the output tables that the dynamic workflow creates

I've attached a workspace that illustrates how this works: serialprimarykey.fmwt


Thanks, I did see that Serial and Primary Key would create what I needed, but I was using Manual over dynamic. I'll have to give dynamic a shot and see how that works as I'm hoping to convert a few hundred shape files overall and looking for any shortcuts I can find!


Thanks, I did see that Serial and Primary Key would create what I needed, but I was using Manual over dynamic. I'll have to give dynamic a shot and see how that works as I'm hoping to convert a few hundred shape files overall and looking for any shortcuts I can find!

Did this work for you?


Reply