Skip to content

Commit 8af3596

Browse files
committed
Async dblink functions require a named connection, and therefore should
use DBLINK_GET_NAMED_CONN rather than DBLINK_GET_CONN. Problem found by Peter Eisentraut and patch by Fujii Masao.
1 parent eb03cff commit 8af3596

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

contrib/dblink/dblink.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -613,16 +613,13 @@ Datum
613613
dblink_send_query(PG_FUNCTION_ARGS)
614614
{
615615
PGconn *conn = NULL;
616-
char *connstr = NULL;
617616
char *sql = NULL;
618617
remoteConn *rconn = NULL;
619-
char *msg;
620-
bool freeconn = false;
621618
int retval;
622619

623620
if (PG_NARGS() == 2)
624621
{
625-
DBLINK_GET_CONN;
622+
DBLINK_GET_NAMED_CONN;
626623
sql = text_to_cstring(PG_GETARG_TEXT_PP(1));
627624
}
628625
else
@@ -711,13 +708,13 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async)
711708
if (PG_NARGS() == 2)
712709
{
713710
/* text,bool */
714-
DBLINK_GET_CONN;
711+
DBLINK_GET_NAMED_CONN;
715712
fail = PG_GETARG_BOOL(1);
716713
}
717714
else if (PG_NARGS() == 1)
718715
{
719716
/* text */
720-
DBLINK_GET_CONN;
717+
DBLINK_GET_NAMED_CONN;
721718
}
722719
else
723720
/* shouldn't happen */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy