Message-ID: From: "omeuid (@omeuid)" To: "postgresql-interfaces/psqlodbc" Date: Fri, 27 Sep 2024 16:34:39 +0000 Subject: Re: [postgresql-interfaces/psqlodbc] issue #42: Why does the ODBC driver expect the password in a connection string to be URL-encoded? In-Reply-To: References: List-Id: X-GitHub-Author-Login: omeuid X-GitHub-Comment-Id: 2379664764 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 42 X-GitHub-Repo: postgresql-interfaces/psqlodbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/postgresql-interfaces/psqlodbc/issues/42#issuecomment-2379664764 Content-Type: text/plain; charset=utf-8 You could use passwords with special characters like '+', '%' or '$' without requiring to URL-encode those values. Why do you assume that using one of those characters in the password is a problem? A generic ODBC client(for any ODBC driver) does not know this kind of requirements for this specific driver. It will use the ODBC api requirerments (See [comments](https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqldriverconnect-function?view=sql-server-ver16#comments) section). So, when a client asks for user credentials, the following connection strings could be created. * If the password contains a special character like '+' --> `DSN=mydsn;UID=myUser;PWD=my+pass` * If the password contains a special character like ';' or '=' --> `DSN=mydsn;UID=myUser;PWD={my;pass}` * If the password contains a special character like ';' or '=' and also a bracker '}' --> `DSN=mydsn;UID=myUser;PWD={my;}}pass}` The first scenario fails with the current implementation of the driver (the '+' symbol should be URL-escaped). Please, feel free to ask me anything which is not clear enough.