v.21.10Improvements

Support ON CONFLICT clause for PostgreSQL table inserts

Support ON CONFLICT clause when inserting into PostgreSQL table engine or table function. Closes #27727. #28081 (Kseniia Sumarokova).
Support for the ON CONFLICT clause when inserting data into PostgreSQL table engine or table function in ClickHouse.

Why it matters

This feature allows handling conflicts during data insertion into PostgreSQL tables by using the ON CONFLICT clause, enabling better control over duplicate key violations and improving data consistency when synchronizing or replicating data from ClickHouse to PostgreSQL.

How to use it

When inserting data into a PostgreSQL table engine or table function, include the ON CONFLICT clause in the INSERT statement to specify conflict handling behavior directly in ClickHouse. For example:

INSERT INTO postgresql('host:port', 'database', 'table', 'user', 'password') ... ON CONFLICT (column) DO UPDATE SET ...