Skip to content

RPA.Database : ProgrammingError: invalid connection option "database"  #1203

@dlopezpastoriza

Description

@dlopezpastoriza

The library psycopg (v3.x) uses "dbname" instead of "database" as psycopg2 to establish the connection, therefore when using the Connect To Database keyword the following error is raised: ProgrammingError: invalid connection option "database"

https://github.com/robocorp/rpaframework/blame/1a357088f96ecad05c9098ff5442c82aaaff1cac/packages/main/src/RPA/Database.py#L286

    elif module_name.startswith("psycopg"):
        self.config.set_default_port(5432)
        self._dbconnection = dbmodule.connect(
            database=self.config.get("database"),   <---- This is not valid for psycopg but for psycopg2
            user=self.config.get("username"),
            password=self.config.get("password"),
            host=self.config.get("host"),
            port=self.config.get("port"),
        )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions