summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2017-09-14 15:50:13 +0200
committerGitHub <noreply@github.com>2017-09-14 15:50:13 +0200
commit5fc7cb0e130ee2c2520c55cced602f6e0a4cf3c3 (patch)
tree34d150dc022cf91c6db129f06bc9535640a0c4f6
parent76f50f3f947a6dae525a1137776c025191694d6c (diff)
parentbd017ce9d9324bc1d6fada3e36401e7a7641e6fb (diff)
downloadsqlparse-5fc7cb0e130ee2c2520c55cced602f6e0a4cf3c3.tar.gz
Merge pull request #357 from Demetrio92/master
add PL/pgSQL syntax
-rw-r--r--sqlparse/keywords.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/sqlparse/keywords.py b/sqlparse/keywords.py
index 086aae9..c63f1cc 100644
--- a/sqlparse/keywords.py
+++ b/sqlparse/keywords.py
@@ -14,6 +14,7 @@ def is_keyword(value):
val = value.upper()
return (KEYWORDS_COMMON.get(val) or
KEYWORDS_ORACLE.get(val) or
+ KEYWORDS_PLPGSQL.get(val) or
KEYWORDS.get(val, tokens.Name)), value
@@ -800,3 +801,18 @@ KEYWORDS_ORACLE = {
'UNLIMITED': tokens.Keyword,
'UNLOCK': tokens.Keyword,
}
+
+# PostgreSQL Syntax
+KEYWORDS_PLPGSQL = {
+ 'PARTITION': tokens.Keyword,
+ 'OVER': tokens.Keyword,
+ 'PERFORM': tokens.Keyword,
+ 'NOTICE': tokens.Keyword,
+ 'PLPGSQL': tokens.Keyword,
+ 'INHERIT': tokens.Keyword,
+ 'INDEXES': tokens.Keyword,
+
+ 'FOR': tokens.Keyword,
+ 'IN': tokens.Keyword,
+ 'LOOP': tokens.Keyword,
+}