summaryrefslogtreecommitdiffstats
path: root/sqlglot/dialects/postgres.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-12 08:28:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-12 08:28:54 +0000
commit7db33518a4264e422294a1e20fbd1c1505d9a62d (patch)
treeaeb9ae54563b1f8f9c26fd54d0c207b082b89cd4 /sqlglot/dialects/postgres.py
parentReleasing debian version 18.2.0-1. (diff)
downloadsqlglot-7db33518a4264e422294a1e20fbd1c1505d9a62d.tar.xz
sqlglot-7db33518a4264e422294a1e20fbd1c1505d9a62d.zip
Merging upstream version 18.3.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/dialects/postgres.py')
-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)}