Skip to main content
Solved

How update existing table saved to PostGis with FME

  • April 9, 2024
  • 6 replies
  • 213 views

gennine
Contributor
Forum|alt.badge.img+4

Hi, I have acheived an attribute update in an existing table in QGIS.
The transfert to PostGis works well when I use "Insert" and "Drop and Create" handling.
However, I can not figure out the operation with "Update" and "Use existing" in order to properly transfert the updated value of the attribute code_dep.

 

Any help is welcome.

Best answer by becchr

‘match columns’ are the field(s) used to identify the record to update, so in your case it should be set to ‘id_dep’ as it is the key field in your data?

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.

6 replies

j.botterill
Influencer
Forum|alt.badge.img+54
  • Influencer
  • April 10, 2024

Hi Gennine, When matching key attributes between two tables or in your case, performing an update where the match column compares values coming into the writer with that of the database table, it is important to consider the null state. I can see the code_dep has <missing> value which the update operation may struggle with to match on

Can you include your transaction log and any warning/error messages


gennine
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • April 10, 2024

Thank you Botterill for your prompt responsiveness. I am attaching part of the log.
But I think that even if it is a NULL or Missing value, normally the transfer of values to PostGis should be executed identically.
I tried other non-NULL values but without success.


becchr
Influencer
Forum|alt.badge.img+32
  • Influencer
  • Best Answer
  • April 10, 2024

‘match columns’ are the field(s) used to identify the record to update, so in your case it should be set to ‘id_dep’ as it is the key field in your data?


gennine
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • April 10, 2024

Many thanks becchr. One last point, updated values to Missing or NULL (in the field for example code_dep) are not handled with this method (old values remain unchanged).


becchr
Influencer
Forum|alt.badge.img+32
  • Influencer
  • April 11, 2024

Many thanks becchr. One last point, updated values to Missing or NULL (in the field for example code_dep) are not handled with this method (old values remain unchanged).

mmm, missings might not update because “those values don’t exist”, but null’s should update I guess

you could use an NullAttributeMapper to change all the missings to nulls or empty strings, those values should update if I’m right


gennine
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • April 11, 2024

It works very well. Many thanks for your valuable advice.