1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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.
This commit is contained in:
Tom Lane
2020-05-14 13:06:38 -04:00
parent 1255466f83
commit 5cbfce562f
198 changed files with 2019 additions and 1786 deletions

View File

@ -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));

View File

@ -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);
}

View File

@ -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

View File

@ -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[] */

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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);
}

View File

@ -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},