geyanggang opened a new issue, #14662:
URL: https://github.com/apache/gravitino/issues/14662

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   `PostgreSqlTableOperations` generates `ALTER COLUMN ... SET DATA TYPE 
<type>` without a `COLLATE` clause when changing a column's type. In 
PostgreSQL, `SET DATA TYPE` without `COLLATE` resets the column to the type's 
default collation, so an explicit non-default column collation is silently lost 
on a type change.
   
   ### Error message and/or stacktrace
   
   No error is raised; the column's collation silently changes from the 
explicit one to the default.
   
   ### How to reproduce
   
   Using the main branch, create a PostgreSQL table with a `varchar COLLATE 
"C"` column, then change that column's type through the connector. The 
collation is no longer `"C"` afterwards.
   
   ### Additional context
   
   Non-text target types must not receive a `COLLATE` clause (PostgreSQL 
rejects it), and columns on the database default collation should be unaffected.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to