summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Conway2011-06-25 22:40:49 +0000
committerJoe Conway2011-06-25 22:40:49 +0000
commite4fb58f894b75829f9475aac6991002c785de4c0 (patch)
treebfb781319f9f6f5846b6691c01d278c13266c338
parentea41b8c822df5a2e4862c76d72937df9b62f1a99 (diff)
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.
-rw-r--r--contrib/dblink/dblink.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c
index 19b98fb73d1..b8d0342085d 100644
--- a/contrib/dblink/dblink.c
+++ b/contrib/dblink/dblink.c
@@ -613,16 +613,13 @@ Datum
dblink_send_query(PG_FUNCTION_ARGS)
{
PGconn *conn = NULL;
- char *connstr = NULL;
char *sql = NULL;
remoteConn *rconn = NULL;
- char *msg;
- bool freeconn = false;
int retval;
if (PG_NARGS() == 2)
{
- DBLINK_GET_CONN;
+ DBLINK_GET_NAMED_CONN;
sql = text_to_cstring(PG_GETARG_TEXT_PP(1));
}
else
@@ -711,13 +708,13 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async)
if (PG_NARGS() == 2)
{
/* text,bool */
- DBLINK_GET_CONN;
+ DBLINK_GET_NAMED_CONN;
fail = PG_GETARG_BOOL(1);
}
else if (PG_NARGS() == 1)
{
/* text */
- DBLINK_GET_CONN;
+ DBLINK_GET_NAMED_CONN;
}
else
/* shouldn't happen */