Skip to content

[fix]Fixing the bug that causes index migration failure in multi-sche…#231

Closed
GodWord wants to merge 1 commit intoSectorLabs:masterfrom
GodWord:vfeng
Closed

[fix]Fixing the bug that causes index migration failure in multi-sche…#231
GodWord wants to merge 1 commit intoSectorLabs:masterfrom
GodWord:vfeng

Conversation

@GodWord
Copy link
Copy Markdown

@GodWord GodWord commented Nov 28, 2023

I think fixing it this way would be better, because in PostgreSQL, the pg_indexes view within the SQL SELECT indexname, indexdef FROM pg_indexes WHERE tablename = %s is used to display index information for all tables. When you execute this query, it returns indexes for all tables that meet the condition, regardless of whether these tables are within the current schema or not.

@Photonios
Copy link
Copy Markdown
Contributor

This breaks a lot of tests. I don't disagree with the change, but it has to be done in a way so that it doesn't break the tests (and thus existing functionality).

@Xzya
Copy link
Copy Markdown

Xzya commented Apr 2, 2025

Any update on this? It's currently impossible to use this library with django-tenants, creating new tenants fails because of this.

@Photonios
Copy link
Copy Markdown
Contributor

I am closing this because nobody has stepped up to get this into a mergable shape. As a work-around, you can use postgres_prepend_local_search_path or postgres_set_local_search_path to control the search path and include/exclude schemas that should be searched.

@Photonios Photonios closed this Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants