Fixed an issue where the column order displayed was incorrect for exclusion constraints with multiple columns. #8430

pull/8475/head
Pravesh Sharma 2025-02-18 11:57:42 +05:30 committed by GitHub
parent 48a26e8979
commit 85290d4e61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 4 deletions

View File

@ -4,8 +4,8 @@
ALTER TABLE IF EXISTS testschema.tableforexclusion
ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" EXCLUDE USING gist (
(col1 + col3) WITH <>,
col2 WITH <>)
col2 WITH <>,
(col1 + col3) WITH <>)
WITH (FILLFACTOR=12)
WHERE (col1 > 1)
DEFERRABLE INITIALLY DEFERRED;

View File

@ -4,8 +4,8 @@
ALTER TABLE IF EXISTS testschema.tableforexclusion
ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" EXCLUDE USING gist (
(col1 + col3) WITH <>,
col2 WITH <>)
col2 WITH <>,
(col1 + col3) WITH <>)
WITH (FILLFACTOR=12)
WHERE (col1 > 1)
DEFERRABLE INITIALLY DEFERRED;

View File

@ -3,6 +3,7 @@
UNION
{% endif %}
SELECT
a.attnum,
i.indoption[{{loop.index -1}}] AS options,
pg_catalog.pg_get_indexdef(i.indexrelid, {{loop.index}}, true) AS coldef,
op.oprname,
@ -21,3 +22,4 @@ LEFT OUTER JOIN pg_catalog.pg_collation coll ON a.attcollation=coll.oid
LEFT OUTER JOIN pg_catalog.pg_namespace nspc ON coll.collnamespace=nspc.oid
WHERE i.indexrelid = {{cid}}::oid
{% endfor %}
ORDER BY attnum