summaryrefslogtreecommitdiff
path: root/sqlparse
diff options
context:
space:
mode:
authorDemetrio92 <Demetrio.Rodriguez.T@gmail.com>2017-08-07 18:02:51 +0200
committerGitHub <noreply@github.com>2017-08-07 18:02:51 +0200
commitc48a221e72dfc0a6631a16e5e42e768249919090 (patch)
tree639ee699c334312556e48bccd728bfc3a3cafb3e /sqlparse
parent7d91d361ad8c26af3fe0a15b807db4cefa5d000a (diff)
downloadsqlparse-c48a221e72dfc0a6631a16e5e42e768249919090.tar.gz
add PL/pgSQL syntax
tested with mxtr/SQLTools
Diffstat (limited to 'sqlparse')
-rw-r--r--sqlparse/keywords.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/sqlparse/keywords.py b/sqlparse/keywords.py
index 40022b9..c9b41d6 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,
+}