Page 1 of 1
imUpdateOrInsert PostgreSQL ?
Posted: Wed 16 Mar 2022 23:02
by luapfr
When setting the PostgreSQL Provider in TUniLoader
in SpecificOptions there is no option imUpdateOrInsert why ?
from what i know postgres has the command similar example :
INSERT INTO customers (name, email)
VALUES('Microsoft','
[email protected]')
ON CONFLICT (name)
DO
UPDATE SET email = EXCLUDED.email || ';' || customers.email;
Re: imUpdateOrInsert PostgreSQL ?
Posted: Thu 17 Mar 2022 11:01
by evgeniym
Hi there,
Thank you for contacting Devart!
TUniLoader uses the COPY command rather than INSERT to speed up data loading into PostgreSQL, because the COPY command is faster.
You can read more about TUniLoader at
https://docs.devart.com/unidac/devart.u ... loader.htm
You can read about the COPY command at
https://www.postgresql.org/docs/14/sql-copy.html
Regards,
Evgeniy
Re: imUpdateOrInsert PostgreSQL ?
Posted: Thu 17 Mar 2022 14:45
by luapfr
I don't understand what you mean by ?
Is there any way to update TUniLoader with Postgres ?
If it exists as it is not mentioned in the documentation.
the fact is it's no use being faster but being limited so if there's no way to update you should implement a way to do it with Insert as an option in postgreSQL
because it makes no sense for you to have implemented this for FirebirdSQL and not for PostgreSQL.
Re: imUpdateOrInsert PostgreSQL ?
Posted: Fri 18 Mar 2022 13:22
by evgeniym
Hi,
The purpose of TUniLoader is to quickly load data into the database. And in the case of PostgreSQL, TUniLoader is implemented through the fastest mechanism - through COPY, and not through INSERT, so no options like UpdateOrInsert are provided.
At the moment, you can use the Batch Updates mechanism to perform the operations you need.
You can read more about Batch Updates here.
https://blog.devart.com/using-batch-ope ... nents.html
Regards,
Evgeniy