-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix(PgSQL): Allow to pass IPv6 address in URI notation for postgres #6344
base: 3.9.x
Are you sure you want to change the base?
Conversation
Thank you for your PR. Please note that we don't merge code changes that are not covered by tests. Is the 3.8.x branch also affected by this bug? If so, please target the 3.8.x branch. |
9159548
to
2f9e58c
Compare
I have added a test now.
Yes, changed the target. |
2f9e58c
to
b96a51d
Compare
The Psalm failure is related to your changes. |
b96a51d
to
2360331
Compare
Should be fixed now |
There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
@derrabus anything I can help with? |
Sorry for the delay. I forgot about this one. 😓 |
tests/Driver/PgSQL/DriverTest.php
Outdated
public function testConnectionIPv6(): void | ||
{ | ||
self::expectNotToPerformAssertions(); | ||
|
||
$params = TestUtil::getConnectionParams(); | ||
$params['host'] = '[::1]'; | ||
|
||
$this->driver->connect($params); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test only works if there's a Postgres server listening on localhost. That's the case in our CI, but we cannot assume that every contributor runs that setup.
Can you maybe check if the host is currently set to localhost
or 127.0.0.1
and skip the test otherwise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is resolved now, should I change the PR target or is 3.9 still valid?
And sorry for the delay!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.9 is still valid.
2360331
to
b2e180b
Compare
Signed-off-by: Ferdinand Thiessen <[email protected]>
b2e180b
to
a81d076
Compare
Summary
Allow to pass IPv6 address of postgres server in URI notation (
[ff:aa:...]
).When the host is passed in URI format to
host
parameter ofpg_connect
it will fail because it then tries to resolve it as when it was a real host name.Instead just pass the IP address to the
hostaddr
parameter.