Merge pull request #179 from lebedov/enable-pgspecial-for-redshift

Enable use of PGSpecial for Redshift databases
pull/193/head
Catherine Devlin 2021-03-14 09:53:23 -04:00 committed by GitHub
commit ee7e209744
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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()