@@ -207,16 +207,21 @@ dblink_get_conn(char *conname_or_str,
207
207
* ensures that VFDs are closed if needed to make room.)
208
208
*/
209
209
if (!AcquireExternalFD ())
210
+ {
211
+ #ifndef WIN32 /* can't write #if within ereport() macro */
210
212
ereport (ERROR ,
211
213
(errcode (ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION ),
212
214
errmsg ("could not establish connection" ),
213
215
errdetail ("There are too many open files on the local server." ),
214
- #ifndef WIN32
215
- errhint ("Raise the server's max_files_per_process and/or \"ulimit -n\" limits." )
216
+ errhint ("Raise the server's max_files_per_process and/or \"ulimit -n\" limits." )));
216
217
#else
217
- errhint ("Raise the server's max_files_per_process setting." )
218
+ ereport (ERROR ,
219
+ (errcode (ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION ),
220
+ errmsg ("could not establish connection" ),
221
+ errdetail ("There are too many open files on the local server." ),
222
+ errhint ("Raise the server's max_files_per_process setting." )));
218
223
#endif
219
- ));
224
+ }
220
225
221
226
/* OK to make connection */
222
227
conn = PQconnectdb (connstr );
@@ -310,16 +315,21 @@ dblink_connect(PG_FUNCTION_ARGS)
310
315
* that VFDs are closed if needed to make room.)
311
316
*/
312
317
if (!AcquireExternalFD ())
318
+ {
319
+ #ifndef WIN32 /* can't write #if within ereport() macro */
313
320
ereport (ERROR ,
314
321
(errcode (ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION ),
315
322
errmsg ("could not establish connection" ),
316
323
errdetail ("There are too many open files on the local server." ),
317
- #ifndef WIN32
318
- errhint ("Raise the server's max_files_per_process and/or \"ulimit -n\" limits." )
324
+ errhint ("Raise the server's max_files_per_process and/or \"ulimit -n\" limits." )));
319
325
#else
320
- errhint ("Raise the server's max_files_per_process setting." )
326
+ ereport (ERROR ,
327
+ (errcode (ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION ),
328
+ errmsg ("could not establish connection" ),
329
+ errdetail ("There are too many open files on the local server." ),
330
+ errhint ("Raise the server's max_files_per_process setting." )));
321
331
#endif
322
- ));
332
+ }
323
333
324
334
/* OK to make connection */
325
335
conn = PQconnectdb (connstr );
0 commit comments