Skip to main content

Hello,

I have two Postgis databases that contain several schemas. Each schema of a database also contains many tables.

How I can do to create a workspace that allows you to copy all the tables of a schema from one database to another. The schema name containing the tables to be copied must be a published parameter. The user must just enter the schema name in order to copy its tables into the other database.

I work with the FME 2017 version but what bothers me is that every time I have to list the schema and choose the feature types to read to use.

To summarize I want to do a dump and restore tables of a schema database Postgis.

Thank you for your help.

For this particular scenario I would actually reconsider using FME and rather use the pg_dump utility. Most importantly, pg_dump will recreate an exact copy of the entire schema structure, somthing that FME can't realistically do, including empty tables, relationships, constraints, sequences, etc. And yes, it will work on geometries too.

If you want to use FME to drive the process, you could use the SystemCaller to execute the pg_dump.exe utility, pick up the dumped SQL script using a FeatureReader (text line) and the apply it to the target schema using the SQLExecutor.


If you're not recreating the schema defintion but only moving data, look into dynamic schemas on the reader/writer in FME: https://knowledge.safe.com/articles/1050/dynamic-workflow-tutorial-introduction.html


For this particular scenario I would actually reconsider using FME and rather use the pg_dump utility. Most importantly, pg_dump will recreate an exact copy of the entire schema structure, somthing that FME can't realistically do, including empty tables, relationships, constraints, sequences, etc. And yes, it will work on geometries too.

If you want to use FME to drive the process, you could use the SystemCaller to execute the pg_dump.exe utility, pick up the dumped SQL script using a FeatureReader (text line) and the apply it to the target schema using the SQLExecutor.

exactly what I thought!

 

 


Reply