I am using a FeatureReader to read a data source (e.g. SHP file) and then immediately writing it to postGIS using a FeatureWriter. Because the input is supposed to be agnostic as to the exact data being uploaded, I am using the "single output port" option and outputting the results via the Generic port, which is being directly fed into the FeatureReader.
In FME 2017 this worked. In 2018 I am having a problem - the writer only works correctly if the destination table already exists (i.e. with the "Use Existing" option).If I use the "Drop and Create" option in the writer, all I get is the geometry column in the destination table. The other columns don't come across.
I saw a forum post where a user was advised to use a dynamic writer and to pass the schema in like this:
https://knowledge.safe.com/questions/46483/generic-attribute-from-featurereader.html
This works, but has one major annoyance - I lose control of the name of the output table - I have to use the fme_feature_type attribute as the table name (and in the case of uploading a CSV file, the destination table is always going to be called "CSV"). I might want to reference the destination table later in code, so not knowing what it's called is a problem.
As I say, writing directly to the table and dropping and creating it seemed to work in FME 2017, but stopped working as soon as I upgraded to 2018. I'm not sure if it is a bug or if the behaviour of the writer has been deliberately changed. Can anyone clarify this?