Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit28a1121

Browse files
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.com
1 parent5cb902e commit28a1121

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/utils/misc/guc_tables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4331,7 +4331,7 @@ struct config_string ConfigureNamesString[] =
43314331
{"search_path",PGC_USERSET,CLIENT_CONN_STATEMENT,
43324332
gettext_noop("Sets the schema search order for names that are not schema-qualified."),
43334333
NULL,
4334-
GUC_LIST_INPUT |GUC_LIST_QUOTE |GUC_EXPLAIN
4334+
GUC_LIST_INPUT |GUC_LIST_QUOTE |GUC_EXPLAIN |GUC_REPORT
43354335
},
43364336
&namespace_search_path,
43374337
"\"$user\", public",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp