From 36390713a60f446da7e7ae758771c9104fa89394 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 24 Feb 2020 18:43:23 -0500 Subject: Fix compile failure. I forgot that some compilers won't handle #if constructs within ereport() calls. Duplicating most of the call is annoying but simple. Per buildfarm. --- contrib/postgres_fdw/connection.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'contrib/postgres_fdw/connection.c') diff --git a/contrib/postgres_fdw/connection.c b/contrib/postgres_fdw/connection.c index a151c2c653f..e45647f3eaf 100644 --- a/contrib/postgres_fdw/connection.c +++ b/contrib/postgres_fdw/connection.c @@ -269,17 +269,23 @@ connect_pg_server(ForeignServer *server, UserMapping *user) * ensures that VFDs are closed if needed to make room.) */ if (!AcquireExternalFD()) + { +#ifndef WIN32 /* can't write #if within ereport() macro */ ereport(ERROR, (errcode(ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION), errmsg("could not connect to server \"%s\"", server->servername), errdetail("There are too many open files on the local server."), -#ifndef WIN32 - errhint("Raise the server's max_files_per_process and/or \"ulimit -n\" limits.") + errhint("Raise the server's max_files_per_process and/or \"ulimit -n\" limits."))); #else - errhint("Raise the server's max_files_per_process setting.") + ereport(ERROR, + (errcode(ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION), + errmsg("could not connect to server \"%s\"", + server->servername), + errdetail("There are too many open files on the local server."), + errhint("Raise the server's max_files_per_process setting."))); #endif - )); + } /* OK to make connection */ conn = PQconnectdbParams(keywords, values, false); -- cgit v1.2.3