From 9efe64777caf82eb6f4a95c6b4a7795d5edc0a98 Mon Sep 17 00:00:00 2001 From: Marco Cameriero Date: Wed, 16 Oct 2024 15:28:29 +0200 Subject: [PATCH] feat(postgres): Ensure ordering of index columns is always stable --- drivers/postgres/postgres.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/postgres/postgres.go b/drivers/postgres/postgres.go index 0d887378..3874c3f0 100644 --- a/drivers/postgres/postgres.go +++ b/drivers/postgres/postgres.go @@ -698,7 +698,7 @@ ORDER BY idx.indexrelid` SELECT cls.relname AS indexname, pg_get_indexdef(idx.indexrelid) AS indexdef, - ARRAY_AGG(attr.attname), + ARRAY_AGG(attr.attname ORDER BY attr.attnum ASC), descr.description AS comment FROM pg_index AS idx INNER JOIN pg_class AS cls ON idx.indexrelid = cls.oid