summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorTom Lane2020-05-14 17:06:38 +0000
committerTom Lane2020-05-14 17:06:50 +0000
commit5cbfce562f7cd2aab0cdc4694ce298ec3567930e (patch)
tree64e722d72fc5f1803cb6f6371d6cf12863e2812f /contrib
parent1255466f8358ecac29581aa5ecec76628dc2e33c (diff)
Initial pgindent and pgperltidy run for v13.
Includes some manual cleanup of places that pgindent messed up, most of which weren't per project style anyway. Notably, it seems some people didn't absorb the style rules of commit c9d297751, because there were a bunch of new occurrences of function calls with a newline just after the left paren, all with faulty expectations about how the rest of the call would get indented.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/adminpack/adminpack.c2
-rw-r--r--contrib/intarray/_int_bool.c4
-rw-r--r--contrib/ltree/_ltree_gist.c4
-rw-r--r--contrib/ltree/ltree.h2
-rw-r--r--contrib/ltree/ltree_gist.c6
-rw-r--r--contrib/pg_stat_statements/pg_stat_statements.c1
-rw-r--r--contrib/pg_visibility/pg_visibility.c2
-rw-r--r--contrib/postgres_fdw/connection.c5
-rw-r--r--contrib/postgres_fdw/option.c12
9 files changed, 20 insertions, 18 deletions
diff --git a/contrib/adminpack/adminpack.c b/contrib/adminpack/adminpack.c
index 3f4b06fdbbd..d064b5a0806 100644
--- a/contrib/adminpack/adminpack.c
+++ b/contrib/adminpack/adminpack.c
@@ -217,7 +217,7 @@ Datum
pg_file_sync(PG_FUNCTION_ARGS)
{
char *filename;
- struct stat fst;
+ struct stat fst;
filename = convert_and_check_filename(PG_GETARG_TEXT_PP(0));
diff --git a/contrib/intarray/_int_bool.c b/contrib/intarray/_int_bool.c
index 58113892d3b..4b6a31080e4 100644
--- a/contrib/intarray/_int_bool.c
+++ b/contrib/intarray/_int_bool.c
@@ -256,7 +256,7 @@ checkcondition_arr(void *checkval, ITEM *item, void *options)
static bool
checkcondition_bit(void *checkval, ITEM *item, void *siglen)
{
- return GETBIT(checkval, HASHVAL(item->val, (int)(intptr_t) siglen));
+ return GETBIT(checkval, HASHVAL(item->val, (int) (intptr_t) siglen));
}
/*
@@ -300,7 +300,7 @@ bool
signconsistent(QUERYTYPE *query, BITVECP sign, int siglen, bool calcnot)
{
return execute(GETQUERY(query) + query->size - 1,
- (void *) sign, (void *)(intptr_t) siglen, calcnot,
+ (void *) sign, (void *) (intptr_t) siglen, calcnot,
checkcondition_bit);
}
diff --git a/contrib/ltree/_ltree_gist.c b/contrib/ltree/_ltree_gist.c
index 95cc367dd81..72516c3b6b9 100644
--- a/contrib/ltree/_ltree_gist.c
+++ b/contrib/ltree/_ltree_gist.c
@@ -407,8 +407,8 @@ gist_te(ltree_gist *key, ltree *query, int siglen)
typedef struct LtreeSignature
{
- BITVECP sign;
- int siglen;
+ BITVECP sign;
+ int siglen;
} LtreeSignature;
static bool
diff --git a/contrib/ltree/ltree.h b/contrib/ltree/ltree.h
index 7eac7c94528..dc68a0c212f 100644
--- a/contrib/ltree/ltree.h
+++ b/contrib/ltree/ltree.h
@@ -272,7 +272,7 @@ typedef struct
#define LTG_GETRNODE(x, siglen) ( LTG_ISONENODE(x) ? LTG_NODE(x) : LTG_RNODE(x, siglen) )
extern ltree_gist *ltree_gist_alloc(bool isalltrue, BITVECP sign, int siglen,
- ltree *left, ltree *right);
+ ltree *left, ltree *right);
/* GiST support for ltree[] */
diff --git a/contrib/ltree/ltree_gist.c b/contrib/ltree/ltree_gist.c
index 041e28064ff..6cf181bc530 100644
--- a/contrib/ltree/ltree_gist.c
+++ b/contrib/ltree/ltree_gist.c
@@ -40,7 +40,7 @@ ltree_gist_alloc(bool isalltrue, BITVECP sign, int siglen,
ltree *left, ltree *right)
{
int32 size = LTG_HDRSIZE + (isalltrue ? 0 : siglen) +
- (left ? VARSIZE(left) + (right ? VARSIZE(right) : 0) : 0);
+ (left ? VARSIZE(left) + (right ? VARSIZE(right) : 0) : 0);
ltree_gist *result = palloc(size);
SET_VARSIZE(result, size);
@@ -557,8 +557,8 @@ gist_between(ltree_gist *key, lquery *query, int siglen)
typedef struct LtreeSignature
{
- BITVECP sign;
- int siglen;
+ BITVECP sign;
+ int siglen;
} LtreeSignature;
static bool
diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c
index 4ce25fb88aa..cef8bb5a49a 100644
--- a/contrib/pg_stat_statements/pg_stat_statements.c
+++ b/contrib/pg_stat_statements/pg_stat_statements.c
@@ -2681,6 +2681,7 @@ JumbleRowMarks(pgssJumbleState *jstate, List *rowMarks)
foreach(lc, rowMarks)
{
RowMarkClause *rowmark = lfirst_node(RowMarkClause, lc);
+
if (!rowmark->pushedDown)
{
APP_JUMB(rowmark->rti);
diff --git a/contrib/pg_visibility/pg_visibility.c b/contrib/pg_visibility/pg_visibility.c
index 0cd1160ceb2..68d580ed1e0 100644
--- a/contrib/pg_visibility/pg_visibility.c
+++ b/contrib/pg_visibility/pg_visibility.c
@@ -384,7 +384,7 @@ pg_truncate_visibility_map(PG_FUNCTION_ARGS)
Oid relid = PG_GETARG_OID(0);
Relation rel;
ForkNumber fork;
- BlockNumber block;
+ BlockNumber block;
rel = relation_open(relid, AccessExclusiveLock);
diff --git a/contrib/postgres_fdw/connection.c b/contrib/postgres_fdw/connection.c
index e45647f3eaf..52d1fe35631 100644
--- a/contrib/postgres_fdw/connection.c
+++ b/contrib/postgres_fdw/connection.c
@@ -303,8 +303,8 @@ connect_pg_server(ForeignServer *server, UserMapping *user)
/*
* Check that non-superuser has used password to establish connection;
* otherwise, he's piggybacking on the postgres server's user
- * identity. See also dblink_security_check() in contrib/dblink
- * and check_conn_params.
+ * identity. See also dblink_security_check() in contrib/dblink and
+ * check_conn_params.
*/
if (!superuser_arg(user->userid) && UserMappingPasswordRequired(user) &&
!PQconnectionUsedPassword(conn))
@@ -361,6 +361,7 @@ UserMappingPasswordRequired(UserMapping *user)
foreach(cell, user->options)
{
DefElem *def = (DefElem *) lfirst(cell);
+
if (strcmp(def->defname, "password_required") == 0)
return defGetBoolean(def);
}
diff --git a/contrib/postgres_fdw/option.c b/contrib/postgres_fdw/option.c
index c442af5bb96..1a03e02263e 100644
--- a/contrib/postgres_fdw/option.c
+++ b/contrib/postgres_fdw/option.c
@@ -144,13 +144,13 @@ postgres_fdw_validator(PG_FUNCTION_ARGS)
}
else if (strcmp(def->defname, "password_required") == 0)
{
- bool pw_required = defGetBoolean(def);
+ bool pw_required = defGetBoolean(def);
/*
* Only the superuser may set this option on a user mapping, or
* alter a user mapping on which this option is set. We allow a
- * user to clear this option if it's set - in fact, we don't have a
- * choice since we can't see the old mapping when validating an
+ * user to clear this option if it's set - in fact, we don't have
+ * a choice since we can't see the old mapping when validating an
* alter.
*/
if (!superuser() && !pw_required)
@@ -204,11 +204,11 @@ InitPgFdwOptions(void)
{"fetch_size", ForeignServerRelationId, false},
{"fetch_size", ForeignTableRelationId, false},
{"password_required", UserMappingRelationId, false},
+
/*
* sslcert and sslkey are in fact libpq options, but we repeat them
- * here to allow them to appear in both foreign server context
- * (when we generate libpq options) and user mapping context
- * (from here).
+ * here to allow them to appear in both foreign server context (when
+ * we generate libpq options) and user mapping context (from here).
*/
{"sslcert", UserMappingRelationId, true},
{"sslkey", UserMappingRelationId, true},