Skip to content

URL encoding missing #1738

Open
Open
@Hansehart

Description

@Hansehart

Describe the bug
I´ve found an issue using PGVector with Haystack. The problem happens in the file conninfo.py in conninfo_to_dict(), when parsing an string like 'postgresql://postgres:p=ssword@postgres:5432/db' in the psycopg repo.

Reading the Postgresql Documentation, you can see that special characters like '=' in the passwords needs to be encoded in '%3D'. When tested it with the encoding, it worked without any problem.

Currently you get the error: psycopg.OperationalError: [Errno -2] Name or service not known, because the password is in this example 'p' and the hostname is 'ssword@postgres'. I created an issue in psycopg

To Reproduce
It happens in this project in the file document_store.py in PgvectorDocumentStore in _ensure_db_setup. The line is: connection = Connection.connect(conn_str). To reproduce, set the var conn_str to 'postgresql://postgres:p=ssword@postgres:5432/db'

Describe your environment (please complete the following information):

  • Ubuntu 24.04
  • Haystack version: 2.13.2
  • Integration version: 3.3.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions