1
1
mirror of https://github.com/dbcli/pgcli.git synced 2024-10-06 10:17:15 +03:00

Merge pull request #449 from davidszotten/fix_execute_from_file

fix execute_from_file after #395
This commit is contained in:
Amjith Ramanujam 2016-02-01 21:23:58 -08:00
commit f8ba5c6f54
2 changed files with 9 additions and 2 deletions

View File

@ -157,7 +157,10 @@ class PGCli(object):
except IOError as e:
return [(None, None, None, str(e))]
return self.pgexecute.run(query, self.pgspecial, on_error=self.on_error)
on_error_resume = (self.on_error == 'RESUME')
return self.pgexecute.run(
query, self.pgspecial, on_error_resume=on_error_resume
)
def initialize_logging(self):

View File

@ -260,7 +260,11 @@ class PGExecute(object):
cur = self.conn.cursor()
try:
for result in pgspecial.execute(cur, sql):
yield result + (sql, True)
# e.g. execute_from_file already appends these
if len(result) < 6:
yield result + (sql, True)
else:
yield result
continue
except special.CommandNotFound:
pass