pgschema icon indicating copy to clipboard operation
pgschema copied to clipboard

Enhancement: Sort indexes alphabetically in dump

Open marcintustin opened this issue 1 year ago • 3 comments

Right now indexes hit the dump in apparently arbitrary order. A stable order like alphabetical would make it easier to see the changes, and to catch unexpected changes (e.g. loss of operator classes).

marcintustin avatar Oct 30 '25 18:10 marcintustin

Not able to reproduce.

Index should be sorted https://github.com/pgschema/pgschema/blob/fd7ba5c04f4bae37785c3d9cca8fe3660a177342/internal/diff/index.go#L19-L23

Test case https://github.com/pgschema/pgschema/blob/main/testdata/dump/issue_133_index_sort/

tianzhou avatar Oct 31 '25 10:10 tianzhou

Thanks I’ll get the latest from main and try again

Marcin Tustin Tel: +1 917 553 3974

On Fri, Oct 31, 2025 at 06:34 Tianzhou @.***> wrote:

tianzhou left a comment (pgschema/pgschema#133) https://github.com/pgschema/pgschema/issues/133#issuecomment-3472409571

Not able to reproduce.

Index should be sorted

https://github.com/pgschema/pgschema/blob/fd7ba5c04f4bae37785c3d9cca8fe3660a177342/internal/diff/index.go#L19-L23

Test case https://github.com/pgschema/pgschema/blob/main/testdata/dump/issue_133_index_sort/

— Reply to this email directly, view it on GitHub https://github.com/pgschema/pgschema/issues/133#issuecomment-3472409571, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJOUOF6XYU7BBYCACVGSYT32M3LDAVCNFSM6AAAAACKWKBLNWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINZSGQYDSNJXGE . You are receiving this because you authored the thread.Message ID: @.***>

marcintustin avatar Oct 31 '25 12:10 marcintustin

Can confirm this is working in recent versions

marcintustin avatar Nov 19 '25 18:11 marcintustin