From 0896ae561b6c799d45cb61d8a3b18fbb442130a7 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Tue, 16 Jul 2019 13:23:53 +0900 Subject: [PATCH] Fix inconsistencies and typos in the tree This is numbered take 7, and addresses a set of issues around: - Fixes for typos and incorrect reference names. - Removal of unneeded comments. - Removal of unreferenced functions and structures. - Fixes regarding variable name consistency. Author: Alexander Lakhin Discussion: https://postgr.es/m/10bfd4ac-3e7c-40ab-2b2e-355ed15495e8@gmail.com --- contrib/cube/cube.c | 2 +- contrib/intarray/_int.h | 6 ------ contrib/ltree/ltxtquery_io.c | 2 +- contrib/pgstattuple/pgstatindex.c | 2 +- doc/src/sgml/gist.sgml | 2 +- src/backend/access/gin/README | 2 +- src/backend/access/gin/ginfast.c | 2 +- src/backend/access/gist/README | 2 +- src/backend/access/gist/gist.c | 2 +- src/backend/access/nbtree/README | 2 +- src/backend/access/spgist/spgscan.c | 5 ----- src/backend/access/transam/clog.c | 2 +- src/backend/bootstrap/bootstrap.c | 2 +- src/backend/catalog/namespace.c | 2 +- src/backend/executor/nodeAgg.c | 2 +- src/backend/optimizer/prep/prepunion.c | 4 ++-- src/backend/parser/parse_agg.c | 2 +- src/backend/rewrite/rewriteManip.c | 2 +- src/backend/storage/buffer/bufmgr.c | 5 +++-- src/backend/storage/file/buffile.c | 2 +- src/backend/storage/file/fd.c | 2 +- src/backend/storage/freespace/freespace.c | 4 ++-- src/backend/storage/lmgr/lock.c | 12 ++++++------ src/backend/storage/lmgr/predicate.c | 6 +++--- src/backend/utils/adt/formatting.c | 2 -- src/backend/utils/adt/inet_cidr_ntop.c | 2 +- src/backend/utils/adt/ruleutils.c | 18 +++++++++--------- src/backend/utils/mmgr/dsa.c | 4 ++-- src/bin/pg_dump/pg_dump.c | 4 +--- src/bin/pg_dump/pg_dump.h | 3 --- src/bin/pg_upgrade/pg_upgrade.c | 2 +- src/include/access/gist_private.h | 2 +- src/include/access/xlog_internal.h | 2 +- src/include/foreign/foreign.h | 11 ----------- src/include/postmaster/postmaster.h | 1 - src/include/storage/fsm_internals.h | 2 +- src/include/storage/predicate_internals.h | 2 +- src/interfaces/ecpg/compatlib/informix.c | 2 +- src/interfaces/ecpg/pgtypeslib/dt_common.c | 2 +- src/port/thread.c | 2 +- src/test/perl/TestLib.pm | 2 +- 41 files changed, 55 insertions(+), 84 deletions(-) diff --git a/contrib/cube/cube.c b/contrib/cube/cube.c index 4f49c5981a..b720366876 100644 --- a/contrib/cube/cube.c +++ b/contrib/cube/cube.c @@ -100,7 +100,7 @@ bool g_cube_leaf_consistent(NDBOX *key, NDBOX *query, StrategyNumber strategy); bool g_cube_internal_consistent(NDBOX *key, NDBOX *query, StrategyNumber strategy); /* -** Auxiliary funxtions +** Auxiliary functions */ static double distance_1D(double a1, double a2, double b1, double b2); static bool cube_is_point_internal(NDBOX *cube); diff --git a/contrib/intarray/_int.h b/contrib/intarray/_int.h index b689eb7ded..f03fdf9add 100644 --- a/contrib/intarray/_int.h +++ b/contrib/intarray/_int.h @@ -85,12 +85,6 @@ typedef struct #define GETSIGN(x) ( (BITVECP)( (char*)x+GTHDRSIZE ) ) -/* - * types for functions - */ -typedef ArrayType *(*formarray) (ArrayType *, ArrayType *); -typedef void (*formfloat) (ArrayType *, float *); - /* * useful functions */ diff --git a/contrib/ltree/ltxtquery_io.c b/contrib/ltree/ltxtquery_io.c index 56bf39d145..b576676746 100644 --- a/contrib/ltree/ltxtquery_io.c +++ b/contrib/ltree/ltxtquery_io.c @@ -368,7 +368,7 @@ queryin(char *buf) state.str = tmp; } - /* set user friendly-operand view */ + /* set user-friendly operand view */ memcpy((void *) GETOPERAND(query), (void *) state.op, state.sumlen); pfree(state.op); diff --git a/contrib/pgstattuple/pgstatindex.c b/contrib/pgstattuple/pgstatindex.c index 2c80753726..4bae176e09 100644 --- a/contrib/pgstattuple/pgstatindex.c +++ b/contrib/pgstattuple/pgstatindex.c @@ -727,7 +727,7 @@ pgstathashindex(PG_FUNCTION_ARGS) } /* ------------------------------------------------- - * GetHashPageStatis() + * GetHashPageStats() * * Collect statistics of single hash page * ------------------------------------------------- diff --git a/doc/src/sgml/gist.sgml b/doc/src/sgml/gist.sgml index 2b43dfc1ca..f1b46fd113 100644 --- a/doc/src/sgml/gist.sgml +++ b/doc/src/sgml/gist.sgml @@ -922,7 +922,7 @@ my_fetch(PG_FUNCTION_ARGS) * Convert 'fetched_data' into the a Datum of the original datatype. */ - /* fill *retval from fetch_data. */ + /* fill *retval from fetched_data. */ gistentryinit(*retval, PointerGetDatum(converted_datum), entry->rel, entry->page, entry->offset, FALSE); diff --git a/src/backend/access/gin/README b/src/backend/access/gin/README index 30c0867829..838fdc0d63 100644 --- a/src/backend/access/gin/README +++ b/src/backend/access/gin/README @@ -163,7 +163,7 @@ algorithms. * The posting list can be accessed with GinGetPosting(itup) -* If GinITupIsCompressed(itup), the posting list is stored in compressed +* If GinItupIsCompressed(itup), the posting list is stored in compressed format. Otherwise it is just an array of ItemPointers. New tuples are always stored in compressed format, uncompressed items can be present if the database was migrated from 9.3 or earlier version. diff --git a/src/backend/access/gin/ginfast.c b/src/backend/access/gin/ginfast.c index 2b3dd1c677..439a91b3e6 100644 --- a/src/backend/access/gin/ginfast.c +++ b/src/backend/access/gin/ginfast.c @@ -1013,7 +1013,7 @@ ginInsertCleanup(GinState *ginstate, bool full_clean, /* * As pending list pages can have a high churn rate, it is desirable to - * recycle them immediately to the FreeSpace Map when ordinary backends + * recycle them immediately to the FreeSpaceMap when ordinary backends * clean the list. */ if (fsm_vac && fill_fsm) diff --git a/src/backend/access/gist/README b/src/backend/access/gist/README index 84a4961d0c..8cbca69296 100644 --- a/src/backend/access/gist/README +++ b/src/backend/access/gist/README @@ -170,7 +170,7 @@ it splits the page, and constructs the new downlink tuples for the split pages. The caller must then call gistplacetopage() on the parent page to insert the downlink tuples. The parent page that holds the downlink to the child might have migrated as a result of concurrent splits of the -parent, gistfindCorrectParent() is used to find the parent page. +parent, gistFindCorrectParent() is used to find the parent page. Splitting the root page works slightly differently. At root split, gistplacetopage() allocates the new child pages and replaces the old root diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index 470b121e7d..dfb51f609d 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -821,7 +821,7 @@ gistdoinsert(Relation r, IndexTuple itup, Size freespace, /* * Leaf page. Insert the new key. We've already updated all the * parents on the way down, but we might have to split the page if - * it doesn't fit. gistinserthere() will take care of that. + * it doesn't fit. gistinserttuple() will take care of that. */ /* diff --git a/src/backend/access/nbtree/README b/src/backend/access/nbtree/README index c5b0a30e4e..3d01b7854d 100644 --- a/src/backend/access/nbtree/README +++ b/src/backend/access/nbtree/README @@ -457,7 +457,7 @@ right sibling's left-link --- followed by a second WAL entry for the insertion on the parent level (which might itself be a page split, requiring an additional insertion above that, etc). -For a root split, the followon WAL entry is a "new root" entry rather than +For a root split, the follow-on WAL entry is a "new root" entry rather than an "insertion" entry, but details are otherwise much the same. Because splitting involves multiple atomic actions, it's possible that the diff --git a/src/backend/access/spgist/spgscan.c b/src/backend/access/spgist/spgscan.c index 7bc5ec09bf..557dd18d7e 100644 --- a/src/backend/access/spgist/spgscan.c +++ b/src/backend/access/spgist/spgscan.c @@ -146,11 +146,6 @@ resetSpGistScanOpaque(SpGistScanOpaque so) { MemoryContext oldCtx; - /* - * clear traversal context before proceeding to the next scan; this must - * not happen before the freeScanStack above, else we get double-free - * crashes. - */ MemoryContextReset(so->traversalCxt); oldCtx = MemoryContextSwitchTo(so->traversalCxt); diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c index 47db7a8a88..d78f706ff7 100644 --- a/src/backend/access/transam/clog.c +++ b/src/backend/access/transam/clog.c @@ -155,7 +155,7 @@ static void TransactionIdSetPageStatusInternal(TransactionId xid, int nsubxids, * NB: this is a low-level routine and is NOT the preferred entry point * for most uses; functions in transam.c are the intended callers. * - * XXX Think about issuing FADVISE_WILLNEED on pages that we will need, + * XXX Think about issuing POSIX_FADV_WILLNEED on pages that we will need, * but aren't yet in cache, as well as hinting pages not to fall out of * cache yet. */ diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index 43627ab8f4..9238fbe98d 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -716,7 +716,7 @@ DefineAttr(char *name, char *type, int attnum, int nullness) namestrcpy(&attrtypes[attnum]->attname, name); elog(DEBUG4, "column %s %s", NameStr(attrtypes[attnum]->attname), type); - attrtypes[attnum]->attnum = attnum + 1; /* fillatt */ + attrtypes[attnum]->attnum = attnum + 1; typeoid = gettype(type); diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index 5fd9eba57f..5cdd51cb5d 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -2399,7 +2399,7 @@ TSParserIsVisible(Oid prsId) /* * get_ts_dict_oid - find a TS dictionary by possibly qualified name * - * If not found, returns InvalidOid if failOK, else throws error + * If not found, returns InvalidOid if missing_ok, else throws error */ Oid get_ts_dict_oid(List *names, bool missing_ok) diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 6b8ef40599..cb4ab4b21e 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -882,7 +882,7 @@ process_ordered_aggregate_multi(AggState *aggstate, * This function handles only one grouping set (already set in * aggstate->current_set). * - * The finalfunction will be run, and the result delivered, in the + * The finalfn will be run, and the result delivered, in the * output-tuple context; caller's CurrentMemoryContext does not matter. * * The finalfn uses the state as set in the transno. This also might be diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c index 6112077851..f5f934ab5c 100644 --- a/src/backend/optimizer/prep/prepunion.c +++ b/src/backend/optimizer/prep/prepunion.c @@ -362,8 +362,8 @@ recurse_set_operations(Node *setOp, PlannerInfo *root, * fix_upper_expr() to the Result node's tlist. This would fail if the * Vars generated by generate_setop_tlist() were not exactly equal() * to the corresponding tlist entries of the subplan. However, since - * the subplan was generated by generate_union_plan() or - * generate_nonunion_plan(), and hence its tlist was generated by + * the subplan was generated by generate_union_paths() or + * generate_nonunion_paths(), and hence its tlist was generated by * generate_append_tlist(), this will work. We just tell * generate_setop_tlist() to use varno 0. */ diff --git a/src/backend/parser/parse_agg.c b/src/backend/parser/parse_agg.c index 8dc3793b5f..1ae4fb5b21 100644 --- a/src/backend/parser/parse_agg.c +++ b/src/backend/parser/parse_agg.c @@ -58,7 +58,7 @@ static int check_agg_arguments(ParseState *pstate, static bool check_agg_arguments_walker(Node *node, check_agg_arguments_context *context); static void check_ungrouped_columns(Node *node, ParseState *pstate, Query *qry, - List *groupClauses, List *groupClauseVars, + List *groupClauses, List *groupClauseCommonVars, bool have_non_var_grouping, List **func_grouped_rels); static bool check_ungrouped_columns_walker(Node *node, diff --git a/src/backend/rewrite/rewriteManip.c b/src/backend/rewrite/rewriteManip.c index 6189a06853..93508c2a87 100644 --- a/src/backend/rewrite/rewriteManip.c +++ b/src/backend/rewrite/rewriteManip.c @@ -1208,7 +1208,7 @@ replace_rte_variables_mutator(Node *node, * a ConvertRowtypeExpr to map back to the rowtype expected by the expression. * (Therefore, to_rowtype had better be a child rowtype of the rowtype of the * RTE we're changing references to.) Callers that don't provide to_rowtype - * should report an error if *found_row_type is true; we don't do that here + * should report an error if *found_whole_row is true; we don't do that here * because we don't know exactly what wording for the error message would * be most appropriate. The caller will be aware of the context. * diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 7332e6b590..6f3a402854 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -438,7 +438,8 @@ static void PinBuffer_Locked(BufferDesc *buf); static void UnpinBuffer(BufferDesc *buf, bool fixOwner); static void BufferSync(int flags); static uint32 WaitBufHdrUnlocked(BufferDesc *buf); -static int SyncOneBuffer(int buf_id, bool skip_recently_used, WritebackContext *flush_context); +static int SyncOneBuffer(int buf_id, bool skip_recently_used, + WritebackContext *wb_context); static void WaitIO(BufferDesc *buf); static bool StartBufferIO(BufferDesc *buf, bool forInput); static void TerminateBufferIO(BufferDesc *buf, bool clear_dirty, @@ -2346,7 +2347,7 @@ BgBufferSync(WritebackContext *wb_context) * BUF_REUSABLE: buffer is available for replacement, ie, it has * pin count 0 and usage count 0. * - * (BUF_WRITTEN could be set in error if FlushBuffers finds the buffer clean + * (BUF_WRITTEN could be set in error if FlushBuffer finds the buffer clean * after locking it, but we don't care all that much.) * * Note: caller must have done ResourceOwnerEnlargeBuffers. diff --git a/src/backend/storage/file/buffile.c b/src/backend/storage/file/buffile.c index b773a76049..b40e6f3fde 100644 --- a/src/backend/storage/file/buffile.c +++ b/src/backend/storage/file/buffile.c @@ -664,7 +664,7 @@ BufFileSeek(BufFile *file, int fileno, off_t offset, int whence) /* * Relative seek considers only the signed offset, ignoring - * fileno. Note that large offsets (> 1 gig) risk overflow in this + * fileno. Note that large offsets (> 1 GB) risk overflow in this * add, unless we have 64-bit off_t. */ newFile = file->curFile; diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index 7b49802b4e..315c74c745 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -897,7 +897,7 @@ count_usable_fds(int max_to_probe, int *usable_fds, int *already_open) /* * set_max_safe_fds - * Determine number of filedescriptors that fd.c is allowed to use + * Determine number of file descriptors that fd.c is allowed to use */ void set_max_safe_fds(void) diff --git a/src/backend/storage/freespace/freespace.c b/src/backend/storage/freespace/freespace.c index c17b3f49dd..2383094cfd 100644 --- a/src/backend/storage/freespace/freespace.c +++ b/src/backend/storage/freespace/freespace.c @@ -223,7 +223,7 @@ XLogRecordPageWithFreeSpace(RelFileNode rnode, BlockNumber heapBlk, } /* - * GetRecordedFreePage - return the amount of free space on a particular page, + * GetRecordedFreeSpace - return the amount of free space on a particular page, * according to the FSM. */ Size @@ -417,7 +417,7 @@ fsm_space_cat_to_avail(uint8 cat) /* * Which category does a page need to have, to accommodate x bytes of data? - * While fsm_size_to_avail_cat() rounds down, this needs to round up. + * While fsm_space_avail_to_cat() rounds down, this needs to round up. */ static uint8 fsm_space_needed_to_cat(Size needed) diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index 6745a2432e..1b7053cb1c 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -216,9 +216,9 @@ static PROCLOCK *FastPathGetRelationLockEntry(LOCALLOCK *locallock); /* * To make the fast-path lock mechanism work, we must have some way of - * preventing the use of the fast-path when a conflicting lock might be - * present. We partition* the locktag space into FAST_PATH_HASH_BUCKETS - * partitions, and maintain an integer count of the number of "strong" lockers + * preventing the use of the fast-path when a conflicting lock might be present. + * We partition* the locktag space into FAST_PATH_STRONG_LOCK_HASH_PARTITIONS, + * and maintain an integer count of the number of "strong" lockers * in each partition. When any "strong" lockers are present (which is * hopefully not very often), the fast-path mechanism can't be used, and we * must fall back to the slower method of pushing matching locks directly @@ -2709,7 +2709,7 @@ FastPathTransferRelationLocks(LockMethod lockMethodTable, const LOCKTAG *locktag } /* - * FastPathGetLockEntry + * FastPathGetRelationLockEntry * Return the PROCLOCK for a lock originally taken via the fast-path, * transferring it to the primary lock table if necessary. * @@ -2896,8 +2896,8 @@ GetLockConflicts(const LOCKTAG *locktag, LOCKMODE lockmode, int *countp) * the lock, then we needn't examine the individual relation IDs * at all; none of them can be relevant. * - * See FastPathTransferLocks() for discussion of why we do this - * test after acquiring the lock. + * See FastPathTransferRelationLocks() for discussion of why we do + * this test after acquiring the lock. */ if (proc->databaseId != locktag->locktag_field1) { diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index 565c3ac439..2d709420c3 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -3405,8 +3405,8 @@ ReleasePredicateLocks(bool isCommit, bool isReadOnlySafe) * * If this value is changing, we don't care that much whether we get the * old or new value -- it is just used to determine how far - * GlobalSerializableXmin must advance before this transaction can be - * fully cleaned up. The worst that could happen is we wait for one more + * SxactGlobalXmin must advance before this transaction can be fully + * cleaned up. The worst that could happen is we wait for one more * transaction to complete before freeing some RAM; correctness of visible * behavior is not affected. */ @@ -4820,7 +4820,7 @@ OnConflict_CheckForSerializationFailure(const SERIALIZABLEXACT *reader, * * If a dangerous structure is found, the pivot (the near conflict) is * marked for death, because rolling back another transaction might mean - * that we flail without ever making progress. This transaction is + * that we fail without ever making progress. This transaction is * committing writes, so letting it commit ensures progress. If we * canceled the far conflict, it might immediately fail again on retry. */ diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index 206576d4bd..b3115e4bea 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -282,8 +282,6 @@ static const char *const numth[] = {"st", "nd", "rd", "th", NULL}; #define ALL_UPPER 2 /* NAME */ #define ALL_LOWER 3 /* name */ -#define FULL_SIZ 0 - #define MAX_MONTH_LEN 9 #define MAX_MON_LEN 3 #define MAX_DAY_LEN 9 diff --git a/src/backend/utils/adt/inet_cidr_ntop.c b/src/backend/utils/adt/inet_cidr_ntop.c index 5fdc3ca251..3000b1735d 100644 --- a/src/backend/utils/adt/inet_cidr_ntop.c +++ b/src/backend/utils/adt/inet_cidr_ntop.c @@ -146,7 +146,7 @@ emsgsize: /* * static char * - * inet_cidr_ntop_ipv6(src, bits, fakebits, dst, size) + * inet_cidr_ntop_ipv6(src, bits, dst, size) * convert IPv6 network number from network to presentation format. * generates CIDR style result always. Picks the shortest representation * unless the IP is really IPv4. diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 3e17032e56..4ca0ed2bbb 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -474,7 +474,7 @@ static char *flatten_reloptions(Oid relid); /* ---------- - * get_ruledef - Do it all and return a text + * pg_get_ruledef - Do it all and return a text * that could be used as a statement * to recreate the rule * ---------- @@ -594,7 +594,7 @@ pg_get_ruledef_worker(Oid ruleoid, int prettyFlags) /* ---------- - * get_viewdef - Mainly the same thing, but we + * pg_get_viewdef - Mainly the same thing, but we * only return the SELECT part of a view * ---------- */ @@ -789,7 +789,7 @@ pg_get_viewdef_worker(Oid viewoid, int prettyFlags, int wrapColumn) } /* ---------- - * get_triggerdef - Get the definition of a trigger + * pg_get_triggerdef - Get the definition of a trigger * ---------- */ Datum @@ -1083,7 +1083,7 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty) } /* ---------- - * get_indexdef - Get the definition of an index + * pg_get_indexdef - Get the definition of an index * * In the extended version, there is a colno argument as well as pretty bool. * if colno == 0, we want a complete index definition. @@ -2342,7 +2342,7 @@ decompile_column_index_array(Datum column_index_array, Oid relId, /* ---------- - * get_expr - Decompile an expression tree + * pg_get_expr - Decompile an expression tree * * Input: an expression tree in nodeToString form, and a relation OID * @@ -2440,7 +2440,7 @@ pg_get_expr_worker(text *expr, Oid relid, const char *relname, int prettyFlags) /* ---------- - * get_userbyid - Get a user name by roleid and + * pg_get_userbyid - Get a user name by roleid and * fallback to 'unknown (OID=n)' * ---------- */ @@ -6811,8 +6811,8 @@ get_variable(Var *var, int levelsup, bool istoplevel, deparse_context *context) /* * Deparse a Var which references OUTER_VAR, INNER_VAR, or INDEX_VAR. This - * routine is actually a callback for get_special_varno, which handles finding - * the correct TargetEntry. We get the expression contained in that + * routine is actually a callback for resolve_special_varno, which handles + * finding the correct TargetEntry. We get the expression contained in that * TargetEntry and just need to deparse it, a job we can throw back on * get_rule_expr. */ @@ -11254,7 +11254,7 @@ flatten_reloptions(Oid relid) } /* - * get_one_range_partition_bound_string + * get_range_partbound_string * A C string representation of one range partition bound */ char * diff --git a/src/backend/utils/mmgr/dsa.c b/src/backend/utils/mmgr/dsa.c index 900cd8357c..6590e55a24 100644 --- a/src/backend/utils/mmgr/dsa.c +++ b/src/backend/utils/mmgr/dsa.c @@ -2235,8 +2235,8 @@ check_for_freed_segments(dsa_area *area) /* * Any other process that has freed a segment has incremented - * free_segment_counter while holding an LWLock, and that must precede any - * backend creating a new segment in the same slot while holding an + * freed_segment_counter while holding an LWLock, and that must precede + * any backend creating a new segment in the same slot while holding an * LWLock, and that must precede the creation of any dsa_pointer pointing * into the new segment which might reach us here, and the caller must * have sent the dsa_pointer to this process using appropriate memory diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 806fc78f04..bbf44a1820 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -6772,9 +6772,7 @@ getInherits(Archive *fout, int *numInherits) /* * Find all the inheritance information, excluding implicit inheritance - * via partitioning. We handle that case using getPartitions(), because - * we want more information about partitions than just the parent-child - * relationship. + * via partitioning. */ appendPQExpBufferStr(query, "SELECT inhrelid, inhparent FROM pg_inherits"); diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h index c3c2ea1473..ccf2153fac 100644 --- a/src/bin/pg_dump/pg_dump.h +++ b/src/bin/pg_dump/pg_dump.h @@ -637,9 +637,6 @@ typedef struct _extensionMemberId ExtensionInfo *ext; /* owning extension */ } ExtensionMemberId; -/* global decls */ -extern bool force_quotes; /* double-quotes for identifiers flag */ - /* placeholders for comment starting and ending delimiters */ extern char g_comment_start[10]; extern char g_comment_end[10]; diff --git a/src/bin/pg_upgrade/pg_upgrade.c b/src/bin/pg_upgrade/pg_upgrade.c index ff78929707..d1975aab2b 100644 --- a/src/bin/pg_upgrade/pg_upgrade.c +++ b/src/bin/pg_upgrade/pg_upgrade.c @@ -264,7 +264,7 @@ prepare_new_cluster(void) { /* * It would make more sense to freeze after loading the schema, but that - * would cause us to lose the frozenids restored by the load. We use + * would cause us to lose the frozenxids restored by the load. We use * --analyze so autovacuum doesn't update statistics later */ prep_status("Analyzing all rows in the new cluster"); diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h index f80694bf9a..9e3958398e 100644 --- a/src/include/access/gist_private.h +++ b/src/include/access/gist_private.h @@ -400,7 +400,7 @@ extern void freeGISTstate(GISTSTATE *giststate); extern void gistdoinsert(Relation r, IndexTuple itup, Size freespace, - GISTSTATE *GISTstate, + GISTSTATE *giststate, Relation heapRel, bool is_build); diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h index 3cc9c3d669..b986a38575 100644 --- a/src/include/access/xlog_internal.h +++ b/src/include/access/xlog_internal.h @@ -323,7 +323,7 @@ extern bool RestoreArchivedFile(char *path, const char *xlogfname, const char *recovername, off_t expectedSize, bool cleanupEnabled); extern void ExecuteRecoveryCommand(const char *command, const char *commandName, - bool failOnerror); + bool failOnSignal); extern void KeepFileRestoredFromArchive(const char *path, const char *xlogfname); extern void XLogArchiveNotify(const char *xlog); extern void XLogArchiveNotifySeg(XLogSegNo segno); diff --git a/src/include/foreign/foreign.h b/src/include/foreign/foreign.h index 46759e3596..4de157c19c 100644 --- a/src/include/foreign/foreign.h +++ b/src/include/foreign/foreign.h @@ -21,17 +21,6 @@ (OidIsValid(userid) ? GetUserNameFromId(userid, false) : "public") -/* - * Generic option types for validation. - * NB! These are treated as flags, so use only powers of two here. - */ -typedef enum -{ - ServerOpt = 1, /* options applicable to SERVER */ - UserMappingOpt = 2, /* options for USER MAPPING */ - FdwOpt = 4 /* options for FOREIGN DATA WRAPPER */ -} GenericOptionFlags; - typedef struct ForeignDataWrapper { Oid fdwid; /* FDW Oid */ diff --git a/src/include/postmaster/postmaster.h b/src/include/postmaster/postmaster.h index 8ccd2afce5..b692d8be11 100644 --- a/src/include/postmaster/postmaster.h +++ b/src/include/postmaster/postmaster.h @@ -52,7 +52,6 @@ extern void InitProcessGlobals(void); extern int MaxLivePostmasterChildren(void); -extern int GetNumShmemAttachedBgworkers(void); extern bool PostmasterMarkPIDForWorkerNotify(int); #ifdef EXEC_BACKEND diff --git a/src/include/storage/fsm_internals.h b/src/include/storage/fsm_internals.h index 0e27db07f2..0ec5a7966f 100644 --- a/src/include/storage/fsm_internals.h +++ b/src/include/storage/fsm_internals.h @@ -1,6 +1,6 @@ /*------------------------------------------------------------------------- * - * fsm_internal.h + * fsm_internals.h * internal functions for free space map * * diff --git a/src/include/storage/predicate_internals.h b/src/include/storage/predicate_internals.h index de7a846cf3..a1b981302d 100644 --- a/src/include/storage/predicate_internals.h +++ b/src/include/storage/predicate_internals.h @@ -52,7 +52,7 @@ typedef uint64 SerCommitSeqNo; * * Eligibility for cleanup of committed transactions is generally determined * by comparing the transaction's finishedBefore field to - * SerializableGlobalXmin. + * SxactGlobalXmin. */ typedef struct SERIALIZABLEXACT { diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c index 13058cf7bf..8fc0a467f7 100644 --- a/src/interfaces/ecpg/compatlib/informix.c +++ b/src/interfaces/ecpg/compatlib/informix.c @@ -811,7 +811,7 @@ rfmtlong(long lng_val, const char *fmt, char *outbuf) /* and fill the temp-string wit '0's up to there. */ dotpos = getRightMostDot(fmt); - /* start to parse the formatstring */ + /* start to parse the format-string */ temp[0] = '\0'; k = value.digits - 1; /* position in the value_string */ for (i = fmt_len - 1, j = 0; i >= 0; i--, j++) diff --git a/src/interfaces/ecpg/pgtypeslib/dt_common.c b/src/interfaces/ecpg/pgtypeslib/dt_common.c index 4c2828db84..e71defaa66 100644 --- a/src/interfaces/ecpg/pgtypeslib/dt_common.c +++ b/src/interfaces/ecpg/pgtypeslib/dt_common.c @@ -172,7 +172,7 @@ static const datetkn datetktbl[] = { ghst #endif {"gilt", TZ, 43200}, /* Gilbert Islands Time */ - {"gmt", TZ, 0}, /* Greenwish Mean Time */ + {"gmt", TZ, 0}, /* Greenwich Mean Time */ {"gst", TZ, 36000}, /* Guam Std Time, USSR Zone 9 */ {"gyt", TZ, -14400}, /* Guyana Time */ {"h", UNITS, DTK_HOUR}, /* "hour" */ diff --git a/src/port/thread.c b/src/port/thread.c index 47995ad060..046f300d07 100644 --- a/src/port/thread.c +++ b/src/port/thread.c @@ -83,7 +83,7 @@ pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer, /* * Wrapper around gethostbyname() or gethostbyname_r() to mimic * POSIX gethostbyname_r() behaviour, if it is not available or required. - * This function is called _only_ by our getaddinfo() portability function. + * This function is called _only_ by our getaddrinfo() portability function. */ #ifndef HAVE_GETADDRINFO int diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm index d2a9828dc6..6195c21c59 100644 --- a/src/test/perl/TestLib.pm +++ b/src/test/perl/TestLib.pm @@ -430,7 +430,7 @@ sub command_exit_is # header file). IPC::Run's result function always returns exit code >> 8, # assuming the Unix convention, which will always return 0 on Windows as # long as the process was not terminated by an exception. To work around - # that, use $h->full_result on Windows instead. + # that, use $h->full_results on Windows instead. my $result = ($Config{osname} eq "MSWin32") ? ($h->full_results)[0]