Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit db35523

Browse files
Merge pull request #11 from fabianmenges/patch-2
[BugFix]: get_check_constraints breaks and does not generate valid SQL
2 parents ca99d92 + 0875e0e commit db35523

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

sqla_vertica_python/vertica_python.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,19 +234,19 @@ def get_check_constraints(self, connection, table_name, schema=None, **kw):
234234
FROM
235235
v_catalog.table_constraints cons
236236
WHERE
237+
cons.constraint_type = 'c'
238+
AND
237239
cons.table_id = (
238240
SELECT
239241
i.table_id
240242
FROM
241-
v_catalog.tables i]
243+
v_catalog.tables i
242244
WHERE
243245
i.table_name='{table_name}'
244-
AND
245-
cons.constraint_type = 'c'
246246
{schema_clause}
247247
)
248248
""".format(table_name=table_name, schema_clause=(
249-
"" if schema is None else "AND i.table_schema ='{schema}'".format(schema)))
249+
"" if schema is None else "AND i.table_schema ='{schema}'".format(schema=schema)))
250250

251251
return [
252252
{

0 commit comments

Comments
 (0)