postgresql/contrib/postgres_fdw
Michael Paquier 8427ce4c37 Fix handling of escape sequences in postgres_fdw.application_name
postgres_fdw.application_name relies on MyProcPort to define the data
that should be added to escape sequences %u (user name) or %d (database
name).  However this code could be run in processes that lack a
MyProcPort, like an autovacuum process, causing crashes.

The code generating the application name is made more flexible with this
commit, so as it now generates no data for %u and %d if MyProcPort is
missing, and a simple "unknown" if MyProcPort exists, but the expected
fields are not set.

Reported-by: Alexander Lakhin
Author: Kyotaro Horiguchi, Michael Paquier
Reviewed-by: Hayato Kuroda, Masahiko Sawada
Discussion: https://postgr.es/m/17789-8b31c5a4672b74d9@postgresql.org
Backpatch-through: 15
2023-02-21 20:01:43 +09:00
..
expected Invent "join domains" to replace the below_outer_join hack. 2023-01-30 13:50:25 -05:00
sql Invent "join domains" to replace the below_outer_join hack. 2023-01-30 13:50:25 -05:00
.gitignore Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
connection.c dblink, postgres_fdw: Handle interrupts during connection establishment 2023-01-23 19:25:23 -08:00
deparse.c Fix various typos in code and tests 2023-02-09 14:43:53 +09:00
Makefile postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00
option.c Fix handling of escape sequences in postgres_fdw.application_name 2023-02-21 20:01:43 +09:00
postgres_fdw--1.0--1.1.sql postgres_fdw: Add functions to discard cached connections. 2021-01-26 15:35:54 +09:00
postgres_fdw--1.0.sql Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.c Do assorted mop-up in the planner. 2023-01-30 13:44:36 -05:00
postgres_fdw.control postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
postgres_fdw.h Check relkind before using TABLESAMPLE in postgres_fdw 2023-01-07 14:39:33 +01:00
shippable.c Remove useless casts to (void *) in hash_search() calls 2023-02-06 09:41:01 +01:00