impossibl / pgjdbc-ng

A new JDBC driver for PostgreSQL aimed at supporting the advanced features of JDBC and Postgres
https://impossibl.github.io/pgjdbc-ng
Other
596 stars 108 forks source link

Allow underscore _ in the host name of a postgres database #575

Open OlgaZittau opened 2 years ago

OlgaZittau commented 2 years ago

Class com.impossibl.postgres.jdbc.ConnectionUtil parses the URLs to connect to a Postgres database. The URLPATTERN does not allow an unserscore '' in the host name - although the underscore is a valid character in host names. Could you fix this? Thank you very much Olga

FrostbittenKing commented 1 year ago

Nope, according to https://kb.iu.edu/d/afqs#:~:text=The%20underscore%20is%20not%20a,the%20hostname%20is%20case%20insensitive. / rfc822 underscore is not a valid character. I had this discussion with our infrastructure guys, cause we ran into this issue in a cloud environment. Not allowing is, on the other hand another can of worms. Cause for infrastructure, underscore is a convenient character / separator for autogenerated urls inside an infrastructure environment. Which is the reason, they had to assign us manually another hostname, that is valid according to pgjdbc-ng.