Skip to main content

I try to create tables where schema definition is from SQL Server into PostGIS. Schema only

For this i have a simple workflow. 

But for the life of me i do not understand why my tables are not created despite FME report everything went well?
String replacer is just changing the name of fme_freature_type_name to remove the standard “dbo.” table qualifyier from SQL Server. 
 

 

Writer setup

 

Log
                           Features Written Summary
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
rplanforslag_alternativ_forslag.RpAngittHensynGrense                         1
rplanforslag_alternativ_forslag.RpAngittHensynSone                           1
rplanforslag_alternativ_forslag.RpArealformålOmråde                        1
==============================================================================
Total Features Written                                                       3
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
-~                                                                             ~-
-~    Feature caches have been recorded at every stage of the translation.     ~-
-~                      To inspect the recorded features,                      ~-
-~              click the feature cache icons next to the ports.               ~-
-~                                                                             ~-
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Translation was SUCCESSFUL with 130 warning(s) (3 feature(s) output)
FME Session Duration: 0.4 seconds. (CPU: 0.1s user, 0.1s system)
END - ProcessID: 5224, peak process memory usage: 51072 kB, current process memory usage: 51012 kB
Translation was SUCCESSFUL

 

As far as i can tell I should expect to see 3 tables in my database now?

The postgis user has all the privileges to create tables in the schema rplanforslag_alternativ_forslag undoubtedly.


Warning is just about attributes case change from upper to lower


Feature Caching is ON
The workspace may run slower because features are being output and recorded on all output ports regardless of whether or not there is a connection.
The current FME process locale has been changed from 'Norwegian Bokmål_Norway.utf8' to 'C' and FME has restored it back to 'Norwegian Bokmål_Norway.utf8'. It is undefined behavior to call 'setlocale()' in plugin code and doing so may cause unexpected errors
POSTGIS Writer: Renamed user attribute 'ID' to 'id' based on format constraints for invalid characters, length, and case
POSTGIS Writer: Renamed user attribute 'Geometri' to 'geometri' based on format constraints for invalid characters, length, and case
POSTGIS Writer: Renamed user attribute 'FØRSTEDATAFANGSTDATO' to 'førstedatafangstdato' based on format constraints for invalid characters, length, and case
​​​

There are 130 warnings. What do they say in your log?

One of the really annoying things about FME, is that failure to Insert/Update/Delete to a database does not generate an error but a warning, and the translation reporting success. I’ve had similar experiences, where the datatype of a single column was not correct, so the database refused the Insert - yet FME still reports 50.000 features written, and translation a success.

So check those errors, and see what they are, and what the database reports.


It used to be, no data, no output. So no result would match my expectation. But I think I have read something about being able to write schema only for this exact case and it probably is a newer version then what your are running, based on your screenshot.

Found it:

So pre 2025, no database table creation without data.

But the workaround is easy, just add one dummy record to force it to create the table and delete it after the table creation. FeatureWriter create and insert, FeatureReader read from created, FeatureWriter delete read feature.

Not related, but the forums are really slow at the morning, am I the only one?


There are 130 warnings. What do they say in your log?

One of the really annoying things about FME, is that failure to Insert/Update/Delete to a database does not generate an error but a warning, and the translation reporting success. I’ve had similar experiences, where the datatype of a single column was not correct, so the database refused the Insert - yet FME still reports 50.000 features written, and translation a success.

So check those errors, and see what they are, and what the database reports.

Updated question. Warming is about case change of attributes


It used to be, no data, no output. So no result would match my expectation. But I think I have read something about being able to write schema only for this exact case and it probably is a newer version then what your are running, based on your screenshot.

Found it:

So pre 2025, no database table creation without data.

But the workaround is easy, just add one dummy record to force it to create the table and delete it after the table creation. FeatureWriter create and insert, FeatureReader read from created, FeatureWriter delete read feature.

Oh that is great news that it is finally part of the core feature of FME. Thanks for pointing this out. Running to upgrade immediately!
About time really. 80% of the times i need to write empty tables, weird to me it has not been implemented before.