#6710 closed (fixed)
DATABASE_OPTIONS ignored for postgresql_psycopg2
| Reported by: | Robert Coup | Owned by: | nobody | 
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev | 
| Severity: | Keywords: | postgres | |
| Cc: | benjamin.slavin@… | Triage Stage: | Accepted | 
| Has patch: | yes | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
Psycopg2 only looks in the kwargs passed to psycopg2.connect() if there is no dsn string. In django this means everything set in settings.DATABASE_OPTIONS is happily ignored (eg. sslmode) because _cursor() builds a dsn string.
The attached patch makes all the db params into a dictionary passed via kwargs instead.
Attachments (1)
Change History (7)
by , 18 years ago
| Attachment: | psycopg2_connection_params.diff added | 
|---|
comment:1 by , 18 years ago
comment:3 by , 17 years ago
Are there any plans to integrate this patch? I prefer to use direct releases/checkouts whenever possible, without having to apply patches and this is pretty much a blocker bug for me at the moment.
comment:4 by , 17 years ago
| Cc: | added | 
|---|
comment:5 by , 17 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
comment:6 by , 17 years ago
  Note:
 See   TracTickets
 for help on using tickets.
    
Link to the relevant code in psycopg2.
Testing for
sslmodeis actually quite nasty:postgresql.confset:log_min_messages=debug5log_min_error_statement=debug5DATABASE_OPTIONS['sslmode']to one of the sslmode settings.