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

[BugFix]: get_check_constraints breaks and does not generate valid SQL #11

Merged
merged 1 commit into from
Jan 17, 2018

Conversation

fabianmenges
Copy link

This fixes both issues.

{schema_clause}
)
""".format(table_name=table_name, schema_clause=(
"" if schema is None else "AND i.table_schema ='{schema}'".format(schema)))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This python breaks with in get_check_constraints "" if schema is None else "AND i.table_schema ='{schema}'".format(schema))) KeyError: 'schema'

cons.table_id = (
SELECT
i.table_id
FROM
v_catalog.tables i]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad syntax

WHERE
i.table_name='{table_name}'
AND
cons.constraint_type = 'c'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong where clause for this filter

@lemeryfertitta
Copy link
Collaborator

Looks good to me. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants