Skip to main content
Question

How do I achieve truncacte and write of all features in one single transaction (PostgreSQL)?

  • March 8, 2018
  • 0 replies
  • 26 views

I want to copy data from a source into a PostgreSQL table and I want the content of the target PG-table to change only if the whole operation is successful.

My approach is to get the truncate and all inserts done in one single transaction. One way to do this is setting “Features Per Transaction” to >= number of features in the source (some hardcoded value, perhaps 9999999999999999999999). But is there a better way?

In the documentation I’ve found info on setting “Features Per Transaction” to VARIABLE in combination with using a fme_db_transaction attribute. I’ve tried this, both setting fme_db_transaction to COMMIT_AFTER and to IGNORE. But the log file still says that there are 1000 features per commit (=the default number).

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.