]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Support for multiple hosts in PostgreSQL connection string
authorRamonWill <ramonwilliams@hotmail.co.uk>
Wed, 2 Sep 2020 22:43:53 +0000 (18:43 -0400)
committerRamonWill <ramonwilliams@hotmail.co.uk>
Tue, 22 Sep 2020 22:04:34 +0000 (23:04 +0100)
commit9b5a37d285bc878a616f02c880c64d452ebaa949
treec82986795a8664784edf3dc28c882067f64ff7e6
parentf0195150c2682c4fcd41f46ce073c59f6ec06347
Support for multiple hosts in PostgreSQL connection string

Provide support for multiple hosts in the PostgreSQL connection string.

A user requested for SQLAlchemy to support multiple hosts within a PostgreSQL URL string. The proposed fix allows this. In the event that the url contains multiple hosts the proposed code will convert the query["hosts"] tuple into a single string. This allows the hosts to then get converted into a valid dsn variable in the psycopg2 connect function.

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [X ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**
Fixes: #4392
Closes: #5554
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5554
Pull-request-sha: 3f7a0ab8df9f1411a9f1ac0e152583bc7bf0c365

Change-Id: I3f3768d51b8331de786ffdc025b7ecfc662eafe5
(cherry picked from commit a3640ae933a80f7c98faf6223cd9376c5deb588a)
doc/build/changelog/unreleased_13/4392.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/psycopg2.py
test/dialect/postgresql/test_dialect.py