diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2013-11-10 09:20:52 -0500 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2013-11-10 14:48:29 -0500 |
commit | 001e114b8d59f4eaf2a314a2bc5e57078afdf82f (patch) | |
tree | 606fa622be346ef917886a29aea7e17383e00d31 /src/backend | |
parent | dca09ac53329e92d73f45674957c26d3d7ae5117 (diff) | |
download | postgresql-001e114b8d59f4eaf2a314a2bc5e57078afdf82f.tar.gz postgresql-001e114b8d59f4eaf2a314a2bc5e57078afdf82f.zip |
Fix whitespace issues found by git diff --check, add gitattributes
Set per file type attributes in .gitattributes to fine-tune whitespace
checks. With the associated cleanups, the tree is now clean for git
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/catalog/aclchk.c | 2 | ||||
-rw-r--r-- | src/backend/catalog/objectaddress.c | 4 | ||||
-rw-r--r-- | src/backend/commands/tablecmds.c | 18 | ||||
-rw-r--r-- | src/backend/nodes/makefuncs.c | 1 | ||||
-rw-r--r-- | src/backend/optimizer/plan/createplan.c | 2 | ||||
-rw-r--r-- | src/backend/parser/gram.y | 46 | ||||
-rw-r--r-- | src/backend/postmaster/bgworker.c | 2 | ||||
-rw-r--r-- | src/backend/storage/ipc/dsm.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/json.c | 72 | ||||
-rw-r--r-- | src/backend/utils/cache/relcache.c | 2 | ||||
-rw-r--r-- | src/backend/utils/error/elog.c | 16 | ||||
-rw-r--r-- | src/backend/utils/misc/guc.c | 2 | ||||
-rw-r--r-- | src/backend/utils/misc/postgresql.conf.sample | 4 |
13 files changed, 85 insertions, 88 deletions
diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c index 97bc93ccd63..06aa76627ab 100644 --- a/src/backend/catalog/aclchk.c +++ b/src/backend/catalog/aclchk.c @@ -3861,7 +3861,7 @@ pg_language_aclmask(Oid lang_oid, Oid roleid, * relative to the same snapshot that will be used to read the underlying * data. The caller will actually pass NULL for an instantaneous MVCC * snapshot, since all we do with the snapshot argument is pass it through - * to systable_beginscan(). + * to systable_beginscan(). */ AclMode pg_largeobject_aclmask_snapshot(Oid lobj_oid, Oid roleid, diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index cecddf12e25..90111908d14 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -2693,7 +2693,7 @@ getObjectIdentity(const ObjectAddress *object) break; case OCLASS_PROC: - appendStringInfoString(&buffer, + appendStringInfoString(&buffer, format_procedure_qualified(object->objectId)); break; @@ -3288,7 +3288,7 @@ getObjectIdentity(const ObjectAddress *object) elog(ERROR, "cache lookup failed for event trigger %u", object->objectId); trigForm = (Form_pg_event_trigger) GETSTRUCT(tup); - appendStringInfoString(&buffer, + appendStringInfoString(&buffer, quote_identifier(NameStr(trigForm->evtname))); ReleaseSysCache(tup); break; diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index c8fa39d025d..0b31f55af28 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -8815,7 +8815,7 @@ ATExecSetRelOptions(Relation rel, List *defList, AlterTableType operation, * actually auto-updatable or not. */ if (check_option) - { + { const char *view_updatable_error = view_query_is_auto_updatable(view_query, security_barrier, true); @@ -10044,10 +10044,10 @@ relation_mark_replica_identity(Relation rel, char ri_type, Oid indexOid, */ pg_class = heap_open(RelationRelationId, RowExclusiveLock); pg_class_tuple = SearchSysCacheCopy1(RELOID, - ObjectIdGetDatum(RelationGetRelid(rel))); + ObjectIdGetDatum(RelationGetRelid(rel))); if (!HeapTupleIsValid(pg_class_tuple)) elog(ERROR, "cache lookup failed for relation \"%s\"", - RelationGetRelationName(rel)); + RelationGetRelationName(rel)); pg_class_form = (Form_pg_class) GETSTRUCT(pg_class_tuple); if (pg_class_form->relreplident != ri_type) { @@ -10115,7 +10115,7 @@ relation_mark_replica_identity(Relation rel, char ri_type, Oid indexOid, simple_heap_update(pg_index, &pg_index_tuple->t_self, pg_index_tuple); CatalogUpdateIndexes(pg_index, pg_index_tuple); InvokeObjectPostAlterHookArg(IndexRelationId, thisIndexOid, 0, - InvalidOid, is_internal); + InvalidOid, is_internal); } heap_freetuple(pg_index_tuple); } @@ -10214,15 +10214,15 @@ ATExecReplicaIdentity(Relation rel, ReplicaIdentityStmt *stmt, LOCKMODE lockmode /* Of the system columns, only oid is indexable. */ if (attno <= 0 && attno != ObjectIdAttributeNumber) elog(ERROR, "internal column %u in unique index \"%s\"", - attno, RelationGetRelationName(indexRel)); + attno, RelationGetRelationName(indexRel)); attr = rel->rd_att->attrs[attno - 1]; if (!attr->attnotnull) ereport(ERROR, - (errcode(ERRCODE_WRONG_OBJECT_TYPE), - errmsg("index \"%s\" cannot be used as replica identity because column \"%s\" is nullable", - RelationGetRelationName(indexRel), - NameStr(attr->attname)))); + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("index \"%s\" cannot be used as replica identity because column \"%s\" is nullable", + RelationGetRelationName(indexRel), + NameStr(attr->attname)))); } /* This index is suitable for use as a replica identity. Mark it. */ diff --git a/src/backend/nodes/makefuncs.c b/src/backend/nodes/makefuncs.c index b742ec95324..4a7e793ae0a 100644 --- a/src/backend/nodes/makefuncs.c +++ b/src/backend/nodes/makefuncs.c @@ -561,4 +561,3 @@ makeFuncCall(List *name, List *args, int location) n->over = NULL; return n; } - diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 9b9eb2ff9de..5947e5b136f 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -116,7 +116,7 @@ static TidScan *make_tidscan(List *qptlist, List *qpqual, Index scanrelid, List *tidquals); static FunctionScan *make_functionscan(List *qptlist, List *qpqual, Index scanrelid, Node *funcexpr, bool ordinality, - List *funccolnames, List *funccoltypes, List *funccoltypmods, + List *funccolnames, List *funccoltypes, List *funccoltypmods, List *funccolcollations); static ValuesScan *make_valuesscan(List *qptlist, List *qpqual, Index scanrelid, List *values_lists); diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 8dc4b1cc53b..11f629118b0 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -3974,7 +3974,7 @@ DropFdwStmt: DROP FOREIGN DATA_P WRAPPER name opt_drop_behavior $$ = (Node *) n; } | DROP FOREIGN DATA_P WRAPPER IF_P EXISTS name opt_drop_behavior - { + { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FDW; n->objects = list_make1(list_make1(makeString($7))); @@ -4136,7 +4136,7 @@ DropForeignServerStmt: DROP SERVER name opt_drop_behavior $$ = (Node *) n; } | DROP SERVER IF_P EXISTS name opt_drop_behavior - { + { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FOREIGN_SERVER; n->objects = list_make1(list_make1(makeString($5))); @@ -4874,8 +4874,8 @@ AlterEnumStmt: ; opt_if_not_exists: IF_P NOT EXISTS { $$ = true; } - | /* empty */ { $$ = false; } - ; + | /* empty */ { $$ = false; } + ; /***************************************************************************** @@ -11168,44 +11168,44 @@ func_application: func_name '(' ')' n->agg_star = TRUE; $$ = (Node *)n; } - ; + ; /* - * func_expr and its cousin func_expr_windowless is split out from c_expr just - * so that we have classifications for "everything that is a function call or - * looks like one". This isn't very important, but it saves us having to document - * which variants are legal in the backwards-compatible functional-index syntax + * func_expr and its cousin func_expr_windowless is split out from c_expr just + * so that we have classifications for "everything that is a function call or + * looks like one". This isn't very important, but it saves us having to document + * which variants are legal in the backwards-compatible functional-index syntax * for CREATE INDEX. * (Note that many of the special SQL functions wouldn't actually make any * sense as functional index entries, but we ignore that consideration here.) */ -func_expr: func_application filter_clause over_clause +func_expr: func_application filter_clause over_clause { - FuncCall *n = (FuncCall*)$1; + FuncCall *n = (FuncCall*)$1; n->agg_filter = $2; n->over = $3; $$ = (Node*)n; - } + } | func_expr_common_subexpr { $$ = $1; } ; -/* +/* * As func_expr but does not accept WINDOW functions directly (they * can still be contained in arguments for functions etc.) - * Use this when window expressions are not allowed, so to disambiguate + * Use this when window expressions are not allowed, so to disambiguate * the grammar. (e.g. in CREATE INDEX) */ -func_expr_windowless: +func_expr_windowless: func_application { $$ = $1; } - | func_expr_common_subexpr { $$ = $1; } + | func_expr_common_subexpr { $$ = $1; } ; /* - * Special expression + * Special expression */ -func_expr_common_subexpr: +func_expr_common_subexpr: COLLATION FOR '(' a_expr ')' { $$ = (Node *) makeFuncCall(SystemFuncName("pg_collation_for"), @@ -11386,8 +11386,8 @@ func_expr_common_subexpr: * at the moment they result in the same thing. */ $$ = (Node *) makeFuncCall(SystemFuncName(((Value *)llast($5->names))->val.str), - list_make1($3), - @1); + list_make1($3), + @1); } | TRIM '(' BOTH trim_list ')' { @@ -11596,9 +11596,9 @@ window_definition: ; filter_clause: - FILTER '(' WHERE a_expr ')' { $$ = $4; } - | /*EMPTY*/ { $$ = NULL; } - ; + FILTER '(' WHERE a_expr ')' { $$ = $4; } + | /*EMPTY*/ { $$ = NULL; } + ; over_clause: OVER window_specification { $$ = $2; } diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c index 48edbb4e30c..bca23809273 100644 --- a/src/backend/postmaster/bgworker.c +++ b/src/backend/postmaster/bgworker.c @@ -877,7 +877,7 @@ GetBackgroundWorkerPid(BackgroundWorkerHandle *handle, pid_t *pidp) /* * Wait for a background worker to start up. - * + * * This is like GetBackgroundWorkerPid(), except that if the worker has not * yet started, we wait for it to do so; thus, BGWH_NOT_YET_STARTED is never * returned. However, if the postmaster has died, we give up and return diff --git a/src/backend/storage/ipc/dsm.c b/src/backend/storage/ipc/dsm.c index 9f9b91a0cac..6df402f2486 100644 --- a/src/backend/storage/ipc/dsm.c +++ b/src/backend/storage/ipc/dsm.c @@ -544,7 +544,7 @@ dsm_backend_startup(void) if (!dsm_control_segment_sane(dsm_control, dsm_control_mapped_size)) { dsm_impl_op(DSM_OP_DETACH, control_handle, 0, - &dsm_control_impl_private, &control_address, + &dsm_control_impl_private, &control_address, &dsm_control_mapped_size, WARNING); ereport(FATAL, (errcode(ERRCODE_INTERNAL_ERROR), diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c index 7685410f185..d8ebf4e0029 100644 --- a/src/backend/utils/adt/json.c +++ b/src/backend/utils/adt/json.c @@ -1786,7 +1786,7 @@ escape_json(StringInfo buf, const char *str) * * Returns the type of the outermost JSON value as TEXT. Possible types are * "object", "array", "string", "number", "boolean", and "null". - * + * * Performs a single call to json_lex() to get the first token of the supplied * value. This initial token uniquely determines the value's type. As our * input must already have been validated by json_in() or json_recv(), the @@ -1796,39 +1796,39 @@ escape_json(StringInfo buf, const char *str) Datum json_typeof(PG_FUNCTION_ARGS) { - text *json = PG_GETARG_TEXT_P(0); - - JsonLexContext *lex = makeJsonLexContext(json, false); - JsonTokenType tok; - char *type; - - /* Lex exactly one token from the input and check its type. */ - json_lex(lex); - tok = lex_peek(lex); - switch (tok) - { - case JSON_TOKEN_OBJECT_START: - type = "object"; - break; - case JSON_TOKEN_ARRAY_START: - type = "array"; - break; - case JSON_TOKEN_STRING: - type = "string"; - break; - case JSON_TOKEN_NUMBER: - type = "number"; - break; - case JSON_TOKEN_TRUE: - case JSON_TOKEN_FALSE: - type = "boolean"; - break; - case JSON_TOKEN_NULL: - type = "null"; - break; - default: - elog(ERROR, "unexpected json token: %d", tok); - } - - PG_RETURN_TEXT_P(cstring_to_text(type)); + text *json = PG_GETARG_TEXT_P(0); + + JsonLexContext *lex = makeJsonLexContext(json, false); + JsonTokenType tok; + char *type; + + /* Lex exactly one token from the input and check its type. */ + json_lex(lex); + tok = lex_peek(lex); + switch (tok) + { + case JSON_TOKEN_OBJECT_START: + type = "object"; + break; + case JSON_TOKEN_ARRAY_START: + type = "array"; + break; + case JSON_TOKEN_STRING: + type = "string"; + break; + case JSON_TOKEN_NUMBER: + type = "number"; + break; + case JSON_TOKEN_TRUE: + case JSON_TOKEN_FALSE: + type = "boolean"; + break; + case JSON_TOKEN_NULL: + type = "null"; + break; + default: + elog(ERROR, "unexpected json token: %d", tok); + } + + PG_RETURN_TEXT_P(cstring_to_text(type)); } diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 9d8caffcacc..d0acca871e3 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -2667,7 +2667,7 @@ RelationBuildLocalRelation(const char *relname, /* system relations and non-table objects don't have one */ if (!IsSystemNamespace(relnamespace) && - (relkind == RELKIND_RELATION || relkind == RELKIND_MATVIEW)) + (relkind == RELKIND_RELATION || relkind == RELKIND_MATVIEW)) rel->rd_rel->relreplident = REPLICA_IDENTITY_DEFAULT; else rel->rd_rel->relreplident = REPLICA_IDENTITY_NOTHING; diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index 31667f4d677..e648792d22e 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -2142,7 +2142,6 @@ process_log_prefix_padding(const char *p, int *ppadding) return NULL; paddingsign = -1; } - /* generate an int version of the numerical string */ while (*p >= '0' && *p <= '9') @@ -2169,7 +2168,7 @@ log_line_prefix(StringInfo buf, ErrorData *edata) /* has counter been reset in current process? */ static int log_my_pid = 0; int padding; - const char *p; + const char *p; /* * This is one of the few places where we'd rather not inherit a static @@ -2284,7 +2283,7 @@ log_line_prefix(StringInfo buf, ErrorData *edata) if (padding != 0) { char strfbuf[128]; - snprintf(strfbuf, sizeof(strfbuf) - 1, "%lx.%x", + snprintf(strfbuf, sizeof(strfbuf) - 1, "%lx.%x", (long) (MyStartTime), MyProcPid); appendStringInfo(buf, "%*s", padding, strfbuf); } @@ -2352,13 +2351,13 @@ log_line_prefix(StringInfo buf, ErrorData *edata) case 'r': if (MyProcPort && MyProcPort->remote_host) { - if (padding != 0) + if (padding != 0) { if (MyProcPort->remote_port && MyProcPort->remote_port[0] != '\0') { - /* + /* * This option is slightly special as the port number - * may be appended onto the end. Here we need to build + * may be appended onto the end. Here we need to build * 1 string which contains the remote_host and optionally * the remote_port (if set) so we can properly align the * string. @@ -2371,7 +2370,6 @@ log_line_prefix(StringInfo buf, ErrorData *edata) } else appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host); - } else { @@ -2379,7 +2377,7 @@ log_line_prefix(StringInfo buf, ErrorData *edata) appendStringInfoString(buf, MyProcPort->remote_host); if (MyProcPort->remote_port && MyProcPort->remote_port[0] != '\0') - appendStringInfo(buf, "(%s)", + appendStringInfo(buf, "(%s)", MyProcPort->remote_port); } @@ -2389,7 +2387,7 @@ log_line_prefix(StringInfo buf, ErrorData *edata) padding > 0 ? padding : -padding); break; case 'h': - if (MyProcPort && MyProcPort->remote_host) + if (MyProcPort && MyProcPort->remote_host) { if (padding != 0) appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host); diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 538d027606b..54d8078fe7a 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -4250,7 +4250,7 @@ SelectConfigFiles(const char *userDoption, const char *progname) pg_timezone_abbrev_initialize(); set_default_effective_cache_size(); - + /* * Figure out where pg_hba.conf is, and make sure the path is absolute. */ diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index 707edf1d91d..34a2d05d39e 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -370,12 +370,12 @@ # panic #log_min_error_statement = error # values in order of decreasing detail: - # debug5 + # debug5 # debug4 # debug3 # debug2 # debug1 - # info + # info # notice # warning # error |