Opened 12 months ago

Last modified 12 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 Yashas Donthi)

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 Mariusz Felisiak, 12 months ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

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?

comment:2 by Yashas Donthi, 12 months ago

I'd like to prepare a patch

comment:3 by Yashas Donthi, 12 months ago

Owner: changed from nobody to Yashas Donthi
Status: newassigned

comment:4 by Yashas Donthi, 12 months ago

Description: modified (diff)
Has patch: set
Note: See TracTickets for help on using tickets.
Back to Top