v.19.14New Feature
Created a Function Currentuser(), Returning Login of Authorized User
Created a functioncurrentUser(), returning login of authorized user. Added aliasuser()for compatibility with MySQL. #6470 (Alex Krash)
Why it matters
This feature allows users to retrieve the currently authorized user's login within queries, facilitating auditing, access control, and session-specific logic execution. The aliasuser() ensures smoother migration and compatibility for users coming from MySQL environments.How to use it
Use the functioncurrentUser() within your SQL queries to get the login of the authorized user. For compatibility, you can also use user(). Example usage:SELECT currentUser();
-- or equivalently
SELECT user();