mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
postgres_fdw: set search_path to 'pg_catalog' while deparsing constants.
The motivation for this is to ensure successful transmission of the values of constants of regconfig and other reg* types. The remote will be reading them with search_path = 'pg_catalog', so schema qualification is necessary when referencing objects in other schemas. Per bug #17483 from Emmanuel Quincerot. Back-patch to all supported versions. (There's some other stuff to do here, but it's less back-patchable.) Discussion: https://postgr.es/m/1423433.1652722406@sss.pgh.pa.us
This commit is contained in:
@ -3896,6 +3896,14 @@ set_transmission_modes(void)
|
||||
PGC_USERSET, PGC_S_SESSION,
|
||||
GUC_ACTION_SAVE, true, 0, false);
|
||||
|
||||
/*
|
||||
* In addition force restrictive search_path, in case there are any
|
||||
* regproc or similar constants to be printed.
|
||||
*/
|
||||
(void) set_config_option("search_path", "pg_catalog",
|
||||
PGC_USERSET, PGC_S_SESSION,
|
||||
GUC_ACTION_SAVE, true, 0, false);
|
||||
|
||||
return nestlevel;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user