Cast OIDs to oid not int, otherwise we lose half the range which results in objects not being accessible. Fixes #1951

This commit is contained in:
Murtuza Zabuawala
2016-11-11 14:36:41 +00:00
committed by Dave Page
parent 6f30cabdbb
commit 00d2ab0338
82 changed files with 128 additions and 128 deletions

View File

@@ -4,5 +4,5 @@ SELECT at.attname, ty.typname
FROM pg_attribute at LEFT JOIN pg_type ty ON (ty.oid = at.atttypid)
WHERE attrelid={{obj_id}}::oid AND attnum = ANY (
(SELECT con.conkey FROM pg_class rel LEFT OUTER JOIN pg_constraint con ON con.conrelid=rel.oid
AND con.contype='p' WHERE rel.relkind IN ('r','s','t') AND rel.oid = {{obj_id}}::oid)::integer[])
AND con.contype='p' WHERE rel.relkind IN ('r','s','t') AND rel.oid = {{obj_id}}::oid)::oid[])
{% endif %}