forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit28a1121
committed
Mark search_path as GUC_REPORT
Report search_path changes to the client. Multi-tenant applicationsoften map tenants to schemas, and use search_path to pick the tenant agiven connection works with. This breaks when a connection pool (likePgBouncer), because the search_path may change unexpectedly.There are other GUCs we might want reported (e.g. various timeouts), butsearch_path is by far the biggest foot gun that can lead either topuzzling failures during query execution (when objects are missing orare defined differently), or even to accessing incorrect data.Many existing tools modify search_path, pg_dump being a notable example.Ideally, clients could specify which GUCs are interesting and should besubject to this reporting, but we don't support that. GUC_REPORT is whatconnection pools rely on for other interesting GUCs, so just use that.When this change was initially proposed in 2014, one of the concerns wasimpact on performance. But this was addressed by commit2432b1a,which ensures we report each GUC at most once per query, no matter howmany times it changed during execution.Eventually, this might be replaced / superseded by allowing doing thisby making the protocol extensible in this direction, but it's unclearwhen (or if) that happens. Until then, we can leverage GUC_REPORT.Author: Alexander Kukushkin, Jelte Fennema-NioDiscussion:https://postgr.es/m/CAFh8B=k8s7WrcqhafmYhdN1+E5LVzZi_QaYDq8bKvrGJTAhY2Q@mail.gmail.com1 parent5cb902e commit28a1121
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4331 | 4331 |
| |
4332 | 4332 |
| |
4333 | 4333 |
| |
4334 |
| - | |
| 4334 | + | |
4335 | 4335 |
| |
4336 | 4336 |
| |
4337 | 4337 |
| |
|
0 commit comments
Comments
(0)