Skip to content

Commit e59b74a

Browse files
committed
dblink: Small code rearrangement for clarity
suggested by Tom Lane
1 parent afd7987 commit e59b74a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

contrib/dblink/dblink.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ Datum
360360
dblink_open(PG_FUNCTION_ARGS)
361361
{
362362
PGresult *res = NULL;
363-
PGconn *conn = NULL;
363+
PGconn *conn;
364364
char *curname = NULL;
365365
char *sql = NULL;
366366
char *conname = NULL;
@@ -408,8 +408,8 @@ dblink_open(PG_FUNCTION_ARGS)
408408

409409
if (!rconn || !rconn->conn)
410410
dblink_conn_not_avail(conname);
411-
else
412-
conn = rconn->conn;
411+
412+
conn = rconn->conn;
413413

414414
/* If we are not in a transaction, start one */
415415
if (PQtransactionStatus(conn) == PQTRANS_IDLE)
@@ -451,7 +451,7 @@ PG_FUNCTION_INFO_V1(dblink_close);
451451
Datum
452452
dblink_close(PG_FUNCTION_ARGS)
453453
{
454-
PGconn *conn = NULL;
454+
PGconn *conn;
455455
PGresult *res = NULL;
456456
char *curname = NULL;
457457
char *conname = NULL;
@@ -495,8 +495,8 @@ dblink_close(PG_FUNCTION_ARGS)
495495

496496
if (!rconn || !rconn->conn)
497497
dblink_conn_not_avail(conname);
498-
else
499-
conn = rconn->conn;
498+
499+
conn = rconn->conn;
500500

501501
appendStringInfo(&buf, "CLOSE %s", curname);
502502

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