diff --git a/docs/en_US/release_notes_7_3.rst b/docs/en_US/release_notes_7_3.rst index 635ffa808..912eaa3c5 100644 --- a/docs/en_US/release_notes_7_3.rst +++ b/docs/en_US/release_notes_7_3.rst @@ -29,3 +29,4 @@ Bug fixes ********* | `Issue #6136 `_ - Fix an issue where editing a database object de-selects it on the browser tree. + | `Issue #6345 `_ - Fixed an issue where Foreign Key with 3 or more columns are shown in the wrong order in SQL and Properties. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/get_constraint_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/get_constraint_cols.sql index 1e8d2c508..aa6b63ca3 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/get_constraint_cols.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/get_constraint_cols.sql @@ -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;