Skip to content

Commit c48a221

Browse files
authored
add PL/pgSQL syntax
tested with mxtr/SQLTools
1 parent 7d91d36 commit c48a221

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

sqlparse/keywords.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def is_keyword(value):
1414
val = value.upper()
1515
return (KEYWORDS_COMMON.get(val) or
1616
KEYWORDS_ORACLE.get(val) or
17+
KEYWORDS_PLPGSQL.get(val) or
1718
KEYWORDS.get(val, tokens.Name)), value
1819

1920

@@ -800,3 +801,18 @@ def is_keyword(value):
800801
'UNLIMITED': tokens.Keyword,
801802
'UNLOCK': tokens.Keyword,
802803
}
804+
805+
# PostgreSQL Syntax
806+
KEYWORDS_PLPGSQL = {
807+
'PARTITION': tokens.Keyword,
808+
'OVER': tokens.Keyword,
809+
'PERFORM': tokens.Keyword,
810+
'NOTICE': tokens.Keyword,
811+
'PLPGSQL': tokens.Keyword,
812+
'INHERIT': tokens.Keyword,
813+
'INDEXES': tokens.Keyword,
814+
815+
'FOR': tokens.Keyword,
816+
'IN': tokens.Keyword,
817+
'LOOP': tokens.Keyword,
818+
}

0 commit comments

Comments
 (0)