#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)
Changed 16 years ago by
Attachment: | psycopg2_connection_params.diff added |
---|
comment:1 Changed 16 years ago by
comment:2 Changed 15 years ago by
Triage Stage: | Unreviewed → Accepted |
---|
help(psycopg2.connect) says it all.
comment:3 Changed 15 years ago by
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 Changed 15 years ago by
Cc: | benjamin.slavin@… added |
---|
comment:5 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Link to the relevant code in psycopg2.
Testing for
sslmode
is actually quite nasty:postgresql.conf
set:log_min_messages=debug5
log_min_error_statement=debug5
DATABASE_OPTIONS['sslmode']
to one of the sslmode settings.