Fixed an issue where Foreign Key with 3 or more columns are shown in the wrong order in SQL and Properties. #6345

This commit is contained in:
Akshay Joshi 2023-06-02 15:01:54 +05:30
parent 99d1c99963
commit 149e093c88
2 changed files with 3 additions and 4 deletions

View File

@ -29,3 +29,4 @@ Bug fixes
*********
| `Issue #6136 <https://github.com/pgadmin-org/pgadmin4/issues/6136>`_ - Fix an issue where editing a database object de-selects it on the browser tree.
| `Issue #6345 <https://github.com/pgadmin-org/pgadmin4/issues/6345>`_ - Fixed an issue where Foreign Key with 3 or more columns are shown in the wrong order in SQL and Properties.

View File

@ -1,10 +1,9 @@
{% for keypair in keys %}
{% if loop.index != 1 %}
UNION
UNION ALL
{% endif %}
SELECT a1.attname as conattname,
a2.attname as confattname,
a1.attnum as attnum
a2.attname as confattname
FROM pg_catalog.pg_attribute a1,
pg_catalog.pg_attribute a2
WHERE a1.attrelid={{tid}}::oid
@ -12,4 +11,3 @@ WHERE a1.attrelid={{tid}}::oid
AND a2.attrelid={{confrelid}}::oid
AND a2.attnum={{keypair[0]}}
{% endfor %}
ORDER BY attnum;