Handle schema-qualified collation value in collate()#12698
Draft
dlax wants to merge 7 commits intosqlalchemy:mainfrom
Draft
Handle schema-qualified collation value in collate()#12698dlax wants to merge 7 commits intosqlalchemy:mainfrom
dlax wants to merge 7 commits intosqlalchemy:mainfrom
Conversation
The 'collation' returned by PGDialect._columns_query() is None if it matches the default collation for the type. On the other hand, if the column collation matches the one of the database but is explicitly set at column creation, the value is reflected. Related to sqlalchemy#6511.
Following a similar approach to 703a323. The CAST(..., BIGINT) for array_agg()'s elements is needed for pg8000.
The previous `if` clause was wrong as it would match the `else` branch if `default_collation_for_types` was `None` whereas we only want that branch to match if the type is in `default_collation_for_types` array.
Otherwise, reflection.cache() decorator does not work.
This avoids a join on pg_collation in _domain_query().
We add a `collation_schema` in types supporting `collation`, along with `postgresql.DOMAIN`, allowing to create respective elements with a schema-qualified collation name. Reflection is also handled for both types and domains. Fix sqlalchemy#9693.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
based on #12697 (and #12510).