trinodb/trino

Support `IF NOT EXISTS` clause in `CREATE VIEW` statement.

Open

#28,076 opened on Feb 2, 2026

View on GitHub
 (1 comment) (1 reaction) (0 assignees)Java (2,678 forks)batch import
enhancementgood first issue

Repository metrics

Stars
 (9,113 stars)
PR merge metrics
 (Avg merge 5d 9h) (306 merged PRs in 30d)

Description

IF NOT EXISTS is supported in CREATE MATERIALIZED VIEW, but not for CREATE VIEW

https://github.com/trinodb/trino/blob/6dafeebd711564a42a5e9556dd3803ce652d56d8/core/trino-grammar/src/main/antlr4/io/trino/grammar/sql/SqlBase.g4#L106-L115

there is IMO no reason not to support IF NOT EXISTS in CREATE VIEW as well

cc @martint

Contributor guide