Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

[resolved] Postgress Bulk insert and Update

Hi all,
There's a requirement were, a large file has to be inserted into the database daily. This job is been scheduled. The output component is tPostgresqlBulkExec. But using this component we can either make Bulk insert or Bulk update, but not Both. Since there's large number records, I cannot use PostgresqlOutput, because using this component it takes it takes long time to execute. I need to make insert/update (to avoid duplicate rows).
Is there any way to do this?

Thanks,
Swathi
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi,
You should use a tMap and check if the key are already present in the Target Database.
You will have two outputs from the tMap:
Output 1, will have rows to insert, linked to a bulk insert
Output 2, will have rows to update, linked to an update component.
regards,
Benjamin

View solution in original post

4 Replies
Anonymous
Not applicable

Hi,
You should use a tMap and check if the key are already present in the Target Database.
You will have two outputs from the tMap:
Output 1, will have rows to insert, linked to a bulk insert
Output 2, will have rows to update, linked to an update component.
regards,
Benjamin
_AnonymousUser
Specialist III
Specialist III
Author

Thanks Benjamin, can you guide me with the function that has to be used in tmap
regards,
Swathi
Anonymous
Not applicable

Thanks Benjamin, can you guide me with the function that has to be used in tmap
regards,
Swathi

No a existing function can be used, you need to query the existing key from target database and do a inner job on tMap, get the matched rows for updating, the unmatched rows for inserting. eg:
tFileInputDelimited--main--tMap-----main--tPostgresqlBulkExec(for inserting)
| -----main--tPostgresqlBulkExec(for updating)
lookup
|
tPostgresInput(select key_column from target_database)
How to do a inner job on tMap and get matched/unmatched rows? see
https://community.talend.com/t5/Design-and-Development/tJMSInput-configurations-for-IBM-MQ-messaging...
Best regards
Shong
_AnonymousUser
Specialist III
Specialist III
Author

Thank you