Bug Description
When using Connect To Database with psycopg (psycopg v3), the following error is raised:
ProgrammingError: invalid connection option "database"
Root Cause
The library internally maps the db_name parameter to database when building the connection kwargs. However, psycopg v3 (psycopg==3.x) expects dbname instead of database. This mapping works for other drivers but is incompatible with psycopg3.
Steps to Reproduce
Connect To Database
... psycopg
... db_name=mydb
... db_user=myuser
... db_password=mypassword
... db_host=localhost
... db_port=5432
Environment
psycopg==3.3.3
psycopg-binary==3.3.3
- Robot Framework DatabaseLibrary
Expected Behavior
Connect To Database should work with psycopg v3 by using dbname instead of database in the connection kwargs.
Workaround
Using Connect To Database Using Custom Params with explicit psycopg3 parameter names works correctly:
Connect To Database Using Custom Params
... psycopg
... dbname='mydb',user='myuser',password='mypassword',host='localhost',port=5432
Suggested Fix
When the connector is psycopg (v3), the internal parameter mapping should use dbname instead of database.
Bug Description
When using
Connect To Databasewithpsycopg(psycopg v3), the following error is raised:Root Cause
The library internally maps the
db_nameparameter todatabasewhen building the connection kwargs. However, psycopg v3 (psycopg==3.x) expectsdbnameinstead ofdatabase. This mapping works for other drivers but is incompatible with psycopg3.Steps to Reproduce
Environment
psycopg==3.3.3psycopg-binary==3.3.3Expected Behavior
Connect To Databaseshould work with psycopg v3 by usingdbnameinstead ofdatabasein the connection kwargs.Workaround
Using
Connect To Database Using Custom Paramswith explicit psycopg3 parameter names works correctly:Suggested Fix
When the connector is
psycopg(v3), the internal parameter mapping should usedbnameinstead ofdatabase.