Enable pgspecial for redshift databases.

pull/179/head
Lev E. Givon 2020-09-23 09:36:08 -04:00
parent b24ac6e941
commit ae2b6755ef
1 changed files with 3 additions and 1 deletions

View File

@ -354,7 +354,9 @@ def run(conn, sql, config, user_namespace):
first_word = sql.strip().split()[0].lower()
if first_word == "begin":
raise Exception("ipython_sql does not support transactions")
if first_word.startswith("\\") and "postgres" in str(conn.dialect):
if first_word.startswith("\\") and \
("postgres" in str(conn.dialect) or \
"redshift" in str(conn.dialect)):
if not PGSpecial:
raise ImportError("pgspecial not installed")
pgspecial = PGSpecial()