dblink_open(PG_FUNCTION_ARGS)
{
PGresult *res = NULL;
- PGconn *conn = NULL;
+ PGconn *conn;
char *curname = NULL;
char *sql = NULL;
char *conname = NULL;
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)
Datum
dblink_close(PG_FUNCTION_ARGS)
{
- PGconn *conn = NULL;
+ PGconn *conn;
PGresult *res = NULL;
char *curname = NULL;
char *conname = NULL;
if (!rconn || !rconn->conn)
dblink_conn_not_avail(conname);
- else
- conn = rconn->conn;
+
+ conn = rconn->conn;
appendStringInfo(&buf, "CLOSE %s", curname);