aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/postgres_fdw')
-rw-r--r--contrib/postgres_fdw/connection.c24
-rw-r--r--contrib/postgres_fdw/deparse.c16
-rw-r--r--contrib/postgres_fdw/option.c4
-rw-r--r--contrib/postgres_fdw/postgres_fdw.c21
-rw-r--r--contrib/postgres_fdw/postgres_fdw.h26
5 files changed, 46 insertions, 45 deletions
diff --git a/contrib/postgres_fdw/connection.c b/contrib/postgres_fdw/connection.c
index 43c7fc9e080..8ca1c1c8986 100644
--- a/contrib/postgres_fdw/connection.c
+++ b/contrib/postgres_fdw/connection.c
@@ -486,11 +486,11 @@ pgfdw_get_result(PGconn *conn, const char *query)
for (;;)
{
- PGresult *res;
+ PGresult *res;
while (PQisBusy(conn))
{
- int wc;
+ int wc;
/* Sleep until there's something to do */
wc = WaitLatchOrSocket(MyLatch,
@@ -675,9 +675,9 @@ pgfdw_xact_callback(XactEvent event, void *arg)
/*
* If a command has been submitted to the remote server by
* using an asynchronous execution function, the command
- * might not have yet completed. Check to see if a command
- * is still being processed by the remote server, and if so,
- * request cancellation of the command.
+ * might not have yet completed. Check to see if a
+ * command is still being processed by the remote server,
+ * and if so, request cancellation of the command.
*/
if (PQtransactionStatus(entry->conn) == PQTRANS_ACTIVE)
{
@@ -689,8 +689,8 @@ pgfdw_xact_callback(XactEvent event, void *arg)
if (!PQcancel(cancel, errbuf, sizeof(errbuf)))
ereport(WARNING,
(errcode(ERRCODE_CONNECTION_FAILURE),
- errmsg("could not send cancel request: %s",
- errbuf)));
+ errmsg("could not send cancel request: %s",
+ errbuf)));
PQfreeCancel(cancel);
}
}
@@ -798,11 +798,11 @@ pgfdw_subxact_callback(SubXactEvent event, SubTransactionId mySubid,
entry->have_error = true;
/*
- * If a command has been submitted to the remote server by using an
- * asynchronous execution function, the command might not have yet
- * completed. Check to see if a command is still being processed by
- * the remote server, and if so, request cancellation of the
- * command.
+ * If a command has been submitted to the remote server by using
+ * an asynchronous execution function, the command might not have
+ * yet completed. Check to see if a command is still being
+ * processed by the remote server, and if so, request cancellation
+ * of the command.
*/
if (PQtransactionStatus(entry->conn) == PQTRANS_ACTIVE)
{
diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c
index 35c27e7fb3c..7d2512cf04d 100644
--- a/contrib/postgres_fdw/deparse.c
+++ b/contrib/postgres_fdw/deparse.c
@@ -1583,10 +1583,10 @@ deparseColumnRef(StringInfo buf, int varno, int varattno, PlannerInfo *root,
/*
* All other system attributes are fetched as 0, except for table OID,
* which is fetched as the local table OID. However, we must be
- * careful; the table could be beneath an outer join, in which case
- * it must go to NULL whenever the rest of the row does.
+ * careful; the table could be beneath an outer join, in which case it
+ * must go to NULL whenever the rest of the row does.
*/
- Oid fetchval = 0;
+ Oid fetchval = 0;
if (varattno == TableOidAttributeNumber)
{
@@ -1633,10 +1633,10 @@ deparseColumnRef(StringInfo buf, int varno, int varattno, PlannerInfo *root,
0 - FirstLowInvalidHeapAttributeNumber);
/*
- * In case the whole-row reference is under an outer join then it has to
- * go NULL whenver the rest of the row goes NULL. Deparsing a join query
- * would always involve multiple relations, thus qualify_col would be
- * true.
+ * In case the whole-row reference is under an outer join then it has
+ * to go NULL whenver the rest of the row goes NULL. Deparsing a join
+ * query would always involve multiple relations, thus qualify_col
+ * would be true.
*/
if (qualify_col)
{
@@ -1652,7 +1652,7 @@ deparseColumnRef(StringInfo buf, int varno, int varattno, PlannerInfo *root,
/* Complete the CASE WHEN statement started above. */
if (qualify_col)
- appendStringInfo(buf," END");
+ appendStringInfo(buf, " END");
heap_close(rel, NoLock);
bms_free(attrs_used);
diff --git a/contrib/postgres_fdw/option.c b/contrib/postgres_fdw/option.c
index f89de2f6947..224aed948eb 100644
--- a/contrib/postgres_fdw/option.c
+++ b/contrib/postgres_fdw/option.c
@@ -133,9 +133,9 @@ postgres_fdw_validator(PG_FUNCTION_ARGS)
}
else if (strcmp(def->defname, "fetch_size") == 0)
{
- int fetch_size;
+ int fetch_size;
- fetch_size = strtol(defGetString(def), NULL,10);
+ fetch_size = strtol(defGetString(def), NULL, 10);
if (fetch_size <= 0)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index 4d172726747..4e31b8e40dd 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -4063,19 +4063,20 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
/*
* Pull the other remote conditions from the joining relations into join
- * clauses or other remote clauses (remote_conds) of this relation wherever
- * possible. This avoids building subqueries at every join step, which is
- * not currently supported by the deparser logic.
+ * clauses or other remote clauses (remote_conds) of this relation
+ * wherever possible. This avoids building subqueries at every join step,
+ * which is not currently supported by the deparser logic.
*
* For an inner join, clauses from both the relations are added to the
- * other remote clauses. For LEFT and RIGHT OUTER join, the clauses from the
- * outer side are added to remote_conds since those can be evaluated after
- * the join is evaluated. The clauses from inner side are added to the
- * joinclauses, since they need to evaluated while constructing the join.
+ * other remote clauses. For LEFT and RIGHT OUTER join, the clauses from
+ * the outer side are added to remote_conds since those can be evaluated
+ * after the join is evaluated. The clauses from inner side are added to
+ * the joinclauses, since they need to evaluated while constructing the
+ * join.
*
- * For a FULL OUTER JOIN, the other clauses from either relation can not be
- * added to the joinclauses or remote_conds, since each relation acts as an
- * outer relation for the other. Consider such full outer join as
+ * For a FULL OUTER JOIN, the other clauses from either relation can not
+ * be added to the joinclauses or remote_conds, since each relation acts
+ * as an outer relation for the other. Consider such full outer join as
* unshippable because of the reasons mentioned above in this comment.
*
* The joining sides can not have local conditions, thus no need to test
diff --git a/contrib/postgres_fdw/postgres_fdw.h b/contrib/postgres_fdw/postgres_fdw.h
index 574b07d16c8..67126bc421f 100644
--- a/contrib/postgres_fdw/postgres_fdw.h
+++ b/contrib/postgres_fdw/postgres_fdw.h
@@ -78,7 +78,7 @@ typedef struct PgFdwRelationInfo
ForeignServer *server;
UserMapping *user; /* only set in use_remote_estimate mode */
- int fetch_size; /* fetch size for this remote table */
+ int fetch_size; /* fetch size for this remote table */
/*
* Name of the relation while EXPLAINing ForeignScan. It is used for join
@@ -133,23 +133,23 @@ extern void deparseUpdateSql(StringInfo buf, PlannerInfo *root,
List *targetAttrs, List *returningList,
List **retrieved_attrs);
extern void deparseDirectUpdateSql(StringInfo buf, PlannerInfo *root,
- Index rtindex, Relation rel,
- List *targetlist,
- List *targetAttrs,
- List *remote_conds,
- List **params_list,
- List *returningList,
- List **retrieved_attrs);
+ Index rtindex, Relation rel,
+ List *targetlist,
+ List *targetAttrs,
+ List *remote_conds,
+ List **params_list,
+ List *returningList,
+ List **retrieved_attrs);
extern void deparseDeleteSql(StringInfo buf, PlannerInfo *root,
Index rtindex, Relation rel,
List *returningList,
List **retrieved_attrs);
extern void deparseDirectDeleteSql(StringInfo buf, PlannerInfo *root,
- Index rtindex, Relation rel,
- List *remote_conds,
- List **params_list,
- List *returningList,
- List **retrieved_attrs);
+ Index rtindex, Relation rel,
+ List *remote_conds,
+ List **params_list,
+ List *returningList,
+ List **retrieved_attrs);
extern void deparseAnalyzeSizeSql(StringInfo buf, Relation rel);
extern void deparseAnalyzeSql(StringInfo buf, Relation rel,
List **retrieved_attrs);