Skip to content

Commit

Permalink
Fixed an issue where the column order displayed was incorrect for exc…
Browse files Browse the repository at this point in the history
…lusion constraints with multiple columns. #8430
  • Loading branch information
pravesh-sharma authored Feb 18, 2025
1 parent 48a26e8 commit 85290d4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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

0 comments on commit 85290d4

Please sign in to comment.