Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection to empty hostname fails #471

Closed
larskanis opened this issue Jul 26, 2022 · 0 comments
Closed

Connection to empty hostname fails #471

larskanis opened this issue Jul 26, 2022 · 0 comments

Comments

@larskanis
Copy link
Collaborator

pg-1.4.1 fails to connect to UnixSocket, when host is given but empty:

3.1.2 :002 > PG::VERSION
 => "1.4.1" 
3.1.2 :003 > PG.connect(host: "")
/home/local/COMCARD-NT/kanis/.rvm/gems/ruby-3.1.2/gems/pg-1.4.1/lib/pg/connection.rb:740:in `connect_to_hosts': PG::ConnectionBad
	from /home/local/COMCARD-NT/kanis/.rvm/gems/ruby-3.1.2/gems/pg-1.4.1/lib/pg/connection.rb:661:in `new'
	from /home/local/COMCARD-NT/kanis/.rvm/gems/ruby-3.1.2/gems/pg-1.4.1/lib/pg.rb:69:in `connect'
	from (irb):3:in `<main>'
	from /home/local/COMCARD-NT/kanis/.rvm/rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
	from /home/local/COMCARD-NT/kanis/.rvm/rubies/ruby-3.1.2/bin/irb:25:in `load'
	from /home/local/COMCARD-NT/kanis/.rvm/rubies/ruby-3.1.2/bin/irb:25:in `<main>'
3.1.2 :004 > PG.connect
 => #<PG::Connection:0x00007fb7d215c048 @last_status=4> 
3.1.2 :005 > 

This is a regression of pg-1.4.0 to 1.4.1. It succeeds in pg-1.3.5:

3.1.2 :002 > PG::VERSION
 => "1.3.5" 
3.1.2 :003 > PG.connect(host: "")
 => #<PG::Connection:0x00007fcd0544aa50> 
3.1.2 :004 > PG.connect
 => #<PG::Connection:0x00007fcd053991b0> 
3.1.2 :005 > 

OS: Ubuntu-22.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant