mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-11-27 07:21:09 +08:00
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.
This commit is contained in:
parent
2742c45080
commit
36390713a6
@ -207,16 +207,21 @@ dblink_get_conn(char *conname_or_str,
|
||||
* 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 establish connection"),
|
||||
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 establish connection"),
|
||||
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 = PQconnectdb(connstr);
|
||||
@ -310,16 +315,21 @@ dblink_connect(PG_FUNCTION_ARGS)
|
||||
* 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 establish connection"),
|
||||
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 establish connection"),
|
||||
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 = PQconnectdb(connstr);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user