dblink: Small code rearrangement for clarity

suggested by Tom Lane
This commit is contained in:
Peter Eisentraut 2017-04-05 09:03:11 -04:00
parent afd79873a0
commit e59b74a3fc
1 changed files with 6 additions and 6 deletions

View File

@ -360,7 +360,7 @@ Datum
dblink_open(PG_FUNCTION_ARGS)
{
PGresult *res = NULL;
PGconn *conn = NULL;
PGconn *conn;
char *curname = NULL;
char *sql = NULL;
char *conname = NULL;
@ -408,8 +408,8 @@ dblink_open(PG_FUNCTION_ARGS)
if (!rconn || !rconn->conn)
dblink_conn_not_avail(conname);
else
conn = rconn->conn;
conn = rconn->conn;
/* If we are not in a transaction, start one */
if (PQtransactionStatus(conn) == PQTRANS_IDLE)
@ -451,7 +451,7 @@ PG_FUNCTION_INFO_V1(dblink_close);
Datum
dblink_close(PG_FUNCTION_ARGS)
{
PGconn *conn = NULL;
PGconn *conn;
PGresult *res = NULL;
char *curname = NULL;
char *conname = NULL;
@ -495,8 +495,8 @@ dblink_close(PG_FUNCTION_ARGS)
if (!rconn || !rconn->conn)
dblink_conn_not_avail(conname);
else
conn = rconn->conn;
conn = rconn->conn;
appendStringInfo(&buf, "CLOSE %s", curname);