Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add upgrade tests for database level collation (#439)
This commit adds upgrade tests for database level collation. For any collatable default constraint, PG adds EXPLICIT collate clause for the default string (const node) iff the collation of the attribute is different from the collation of the datatype stored in pg_type catalog. This is the result of invocation of pg_get_constraintdef() function which finally calls get_const_expr(). To set the collation of the Const node, it calls get_const_collation() function where explicit COLLATE clause is added based on the aforementioned condition. Hence, when we create a database with non-default collation then the collatable columns get collated with the database level collation (if not mentioned explicitly). But we store the collation of the collatable datatypes as server level collation which fulfils the condition mentioned above. To solve this issue, we simply enclose the decompiled DEFAULT expression by PARENTHESIS to avoid invalid syntax. Extension PR: babelfish-for-postgresql/babelfish_extensions#2919 Task: BABEL-5141 Signed-off-by: Shameem Ahmed <[email protected]>
- Loading branch information