v.25.11New Feature

Support CREATE OR REPLACE syntax

Support CREATE OR REPLACE syntax for temporary tables. Closes #35888. #89450 (Aleksandr Musorin).
Support for CREATE OR REPLACE syntax when creating temporary tables in ClickHouse.

Why it matters

This feature allows users to create or atomically replace temporary tables without manually dropping them first. It simplifies workflow by enabling seamless updates to temporary tables, reducing errors and improving script idempotency.

How to use it

Use the CREATE OR REPLACE TEMPORARY TABLE statement as follows:

CREATE OR REPLACE TEMPORARY TABLE table_name AS SELECT ...;

This will create a new temporary table or replace the existing one with the same name if it exists.