Use the correct OID for retrieving properties of freshly created exclusion constraints. Fixes #1896

This commit is contained in:
Murtuza Zabuawala
2017-01-09 15:05:22 +05:30
committed by Dave Page
parent e400693126
commit 4c19f93b3b
7 changed files with 13 additions and 13 deletions

View File

@@ -622,7 +622,7 @@ class ExclusionConstraintView(PGChildNodeView):
return make_json_response( return make_json_response(
status=400, status=400,
success=0, success=0,
errormsg=e errormsg=str(e)
) )
@check_precondition @check_precondition

View File

@@ -1,4 +1,4 @@
SELECT ct.oid SELECT ct.conindid AS oid
FROM pg_constraint ct FROM pg_constraint ct
WHERE contype='x' AND WHERE contype='x' AND
ct.conname = {{ name|qtLiteral }}; ct.conname = {{ name|qtLiteral }};

View File

@@ -1,6 +1,6 @@
SELECT ct.oid, SELECT ct.conindid AS oid,
ct.conname as name, ct.conname AS name,
NOT convalidated as convalidated NOT convalidated AS convalidated
FROM pg_constraint ct FROM pg_constraint ct
WHERE contype='x' AND WHERE contype='x' AND
conrelid = {{tid}}::oid LIMIT 1; conrelid = {{tid}}::oid LIMIT 1;

View File

@@ -1,4 +1,4 @@
SELECT ct.oid SELECT ct.conindid AS oid
FROM pg_constraint ct FROM pg_constraint ct
WHERE contype='x' AND WHERE contype='x' AND
ct.conname = {{ name|qtLiteral }}; ct.conname = {{ name|qtLiteral }};

View File

@@ -1,6 +1,6 @@
SELECT ct.oid, SELECT ct.conindid AS oid,
ct.conname as name, ct.conname AS name,
NOT convalidated as convalidated NOT convalidated AS convalidated
FROM pg_constraint ct FROM pg_constraint ct
WHERE contype='x' AND WHERE contype='x' AND
conrelid = {{tid}}::oid LIMIT 1; conrelid = {{tid}}::oid LIMIT 1;

View File

@@ -1,4 +1,4 @@
SELECT ct.oid SELECT ct.conindid AS oid
FROM pg_constraint ct FROM pg_constraint ct
WHERE contype='x' AND WHERE contype='x' AND
ct.conname = {{ name|qtLiteral }}; ct.conname = {{ name|qtLiteral }};

View File

@@ -1,6 +1,6 @@
SELECT ct.oid, SELECT ct.conindid AS oid,
ct.conname as name, ct.conname AS name,
NOT convalidated as convalidated NOT convalidated AS convalidated
FROM pg_constraint ct FROM pg_constraint ct
WHERE contype='x' AND WHERE contype='x' AND
conrelid = {{tid}}::oid LIMIT 1; conrelid = {{tid}}::oid LIMIT 1;