Conversation
2d4a0a5 to
d80fd21
Compare
| t.typname AS type, | ||
| format_type(a.atttypid, a.atttypmod) AS complete_type, | ||
| (SELECT tc.collcollate FROM pg_catalog.pg_collation tc WHERE tc.oid = a.attcollation) AS collation, | ||
| (SELECT tc.collname FROM pg_catalog.pg_collation tc WHERE tc.oid = a.attcollation) AS collation, |
There was a problem hiding this comment.
You should explain why this change is OK and necessary (if it is).
There was a problem hiding this comment.
Yes, it's necessary, as collcollate was returning NULL. collname is what's actually used in SQL, while collcollate is described in the docs as:
LC_COLLATE for this collation object. If the provider is not libc, collcollate is NULL and colllocale is used instead.
There was a problem hiding this comment.
Please include something about this in your commit message. Was this already used for something where it's ok to get null?
There was a problem hiding this comment.
@greg0ire Commit message updated. This query seems to be used only for introspection. collname may still be null if the field is not of a string data type.
The `selectTableColumns` query was updated to use `collname`, as that is the value used in SQL, whereas `collcollate` represents the underlying operating system `LC_COLLATE` value.
d80fd21 to
3cdebf6
Compare
Summary
Currently, column collation changes are ignored by the schema comparator when using
PostgreSQLPlatform.This PR fixes the issue.
The
selectTableColumnsquery was updated to usecollname, as it is the value used in SQL, whereascollcollaterepresents the underlying operating systemLC_COLLATEvalue.