summaryrefslogtreecommitdiffstats
path: root/sqlglot/dialects/postgres.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sqlglot/dialects/postgres.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/sqlglot/dialects/postgres.py b/sqlglot/dialects/postgres.py
index c26e121..5027013 100644
--- a/sqlglot/dialects/postgres.py
+++ b/sqlglot/dialects/postgres.py
@@ -190,7 +190,11 @@ def _remove_target_from_merge(expression: exp.Expression) -> exp.Expression:
if isinstance(expression, exp.Merge):
alias = expression.this.args.get("alias")
- normalize = lambda identifier: Postgres.normalize_identifier(identifier).name
+ normalize = (
+ lambda identifier: Postgres.normalize_identifier(identifier).name
+ if identifier
+ else None
+ )
targets = {normalize(expression.this.this)}