Content-Length: 310401 | pFad | http://github.com/tonybelloni/postgres/commit/e59b74a3fc524a658172d9ec9f1728da89136bce

1A dblink: Small code rearrangement for clarity · tonybelloni/postgres@e59b74a · GitHub
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

+6-6
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/tonybelloni/postgres/commit/e59b74a3fc524a658172d9ec9f1728da89136bce

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy