1) Added support for Default Partition. Fixes #3938

2) Ensure that record should be add/edited for root partition table with primary keys. Fixes #4104
This commit is contained in:
Khushboo Vashi
2019-04-11 13:25:24 +05:30
committed by Akshay Joshi
parent 9c3925e448
commit a9d964b5ca
8 changed files with 121 additions and 47 deletions

View File

@@ -0,0 +1,8 @@
{# ============= Fetch the primary keys for given object id ============= #}
{% if obj_id %}
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', 'p') AND rel.oid = {{obj_id}}::oid)::oid[])
{% endif %}