Opened 13 months ago
Last modified 13 months ago
#35016 closed Cleanup/optimization
Missing documentation for setting libpq options with the PostgreSQL backend — at Version 4
Reported by: | Roman Donchenko | Owned by: | Yashas Donthi |
---|---|---|---|
Component: | Documentation | Version: | 5.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
As far as I can see, when a database uses the django.db.backends.postgresql
engine, any options from the OPTIONS
key that are not recognized by the engine itself are passed directly to the underlying libpq library. This way you can set options like `sslmode`.
But this doesn't seem to actually be documented anywhere, so it's unclear whether this is actually a supported feature or just an implementation artifact.
If this really is supported, then it should be documented - presumably in PostgreSQL notes.
PR #17586 to fix this: https://github.com/django/django/pull/17586
Change History (4)
comment:1 by , 13 months ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Cleanup/optimization |
comment:3 by , 13 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 13 months ago
Description: | modified (diff) |
---|---|
Has patch: | set |
This vary depending on your database backend (as documented), but I agree that it's worth mentioning that the PostgreSQL backend passes the content of OPTIONS as keyword arguments to the connection constructor, allowing for more advanced control of driver behavior.
Would you like to prepare a patch?