Replies: 1 comment 3 replies
-
I think we need a convention of the display name. Here is the difference between different databases. PostgresIn postgres, every unquoted identifier will be displayed as lower case string:
And it will keep the original string for the quoted indentifier(which is part of SQL standard):
For anoymous columns(e.g. scalar expressions select target without alias), it will display
But for functions, it will display the function name, and it also allows to reference the functions with its name:
MySQLIn MySQL, things get much simpler. It seems MySQL just use the original string of the identifier(or expression) as it's display name. And the interesting thing is, it allows to reference the expressions with its name:
SnowflakeSnowflake is much more simpler, it will display all the unquoted column in upper-case. And for the expressions with witespace inside, it will keep the whitespaces:
My suggestionFor columns, there are three kinds situations:
In SQL standard, a quoted identifier is case-sensitive, and the unquoted identifier aren't needed to be case-sensitive. So if we are tending to access a column bound with quoted identifier, we have to use a quoted identifier to reference it. Therefore it's more reasonable to display quoted identifier in original case, and display other case-insensitive identifiers in lower-case or upper-case(I prefer lower-case because it's easy to type with keyboard):
For expressions, we can display the original string to help user to address the expression in SQL easier. For example:
|
Beta Was this translation helpful? Give feedback.
-
Summary
Beta Was this translation helpful? Give feedback.
All reactions