summaryrefslogtreecommitdiffstats
path: root/pgcli
diff options
context:
space:
mode:
authorIrina Truong <i.chernyavska@gmail.com>2018-06-16 14:54:52 -0700
committerIrina Truong <i.chernyavska@gmail.com>2018-06-16 21:49:28 -0700
commit8ee20aa82ebf4600117820f03cbe2453abae84ae (patch)
treefe3b398fe0f195aeb6593238d2a75d6d2ef2703c /pgcli
parent7812a7bad7370283cd6bfccf25d3a02c6bbb6e5b (diff)
Fix for 'only named arguments may follow *expression'
Diffstat (limited to 'pgcli')
-rw-r--r--pgcli/pgexecute.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pgcli/pgexecute.py b/pgcli/pgexecute.py
index ba5e8123..04baa1fc 100644
--- a/pgcli/pgexecute.py
+++ b/pgcli/pgexecute.py
@@ -410,7 +410,7 @@ class PGExecute(object):
template = 'CREATE OR REPLACE {6} VIEW {0}.{1} AS \n{3}'
# 2: relkind, v or m (materialized)
- # 4: reloptions, null
+ # 4: reloptions, null
# 5: checkoption: local or cascaded
with self.conn.cursor() as cur:
sql = self.view_definition_query
@@ -422,7 +422,7 @@ class PGExecute(object):
raise RuntimeError('View {} does not exist.'.format(spec))
result = cur.fetchone()
view_type = 'MATERIALIZED' if result[2] == 'm' else ''
- return template.format(*result, view_type)
+ return template.format(*result + [view_type])
def function_definition(self, spec):
"""Returns the SQL defining functions described by `spec` """