@@ -116,13 +116,15 @@ typedef struct remoteConnHashEnt
116116var_ = NULL; \
117117} \
118118} while (0)
119+
119120#define DBLINK_RES_INTERNALERROR (p2 ) \
120121do { \
121122msg = pstrdup(PQerrorMessage(conn)); \
122123if (res) \
123124PQclear(res); \
124125elog(ERROR, "%s: %s", p2, msg); \
125126} while (0)
127+
126128#define DBLINK_RES_ERROR (p2 ) \
127129do { \
128130msg = pstrdup(PQerrorMessage(conn)); \
@@ -133,6 +135,7 @@ typedef struct remoteConnHashEnt
133135 errmsg("%s", p2), \
134136 errdetail("%s", msg))); \
135137} while (0)
138+
136139#define DBLINK_RES_ERROR_AS_NOTICE (p2 ) \
137140do { \
138141msg = pstrdup(PQerrorMessage(conn)); \
@@ -143,6 +146,7 @@ typedef struct remoteConnHashEnt
143146 errmsg("%s", p2), \
144147 errdetail("%s", msg))); \
145148} while (0)
149+
146150#define DBLINK_CONN_NOT_AVAIL \
147151do { \
148152if(conname) \
@@ -154,6 +158,7 @@ typedef struct remoteConnHashEnt
154158(errcode(ERRCODE_CONNECTION_DOES_NOT_EXIST), \
155159 errmsg("connection not available"))); \
156160} while (0)
161+
157162#define DBLINK_GET_CONN \
158163do { \
159164char *conname_or_str = GET_STR(PG_GETARG_TEXT_P(0)); \
@@ -2039,7 +2044,7 @@ createConnHash(void)
20392044}
20402045
20412046static void
2042- createNewConnection (const char * name ,remoteConn * con )
2047+ createNewConnection (const char * name ,remoteConn * rconn )
20432048{
20442049remoteConnHashEnt * hentry ;
20452050bool found ;
@@ -2058,7 +2063,7 @@ createNewConnection(const char *name, remoteConn * con)
20582063(errcode (ERRCODE_DUPLICATE_OBJECT ),
20592064errmsg ("duplicate connection name" )));
20602065
2061- hentry -> rcon = con ;
2066+ hentry -> rcon = rconn ;
20622067strncpy (hentry -> name ,name ,NAMEDATALEN - 1 );
20632068}
20642069