Phase 2 of pgindent updates.

Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.

Commit e3860ffa4d wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code.  The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there.  BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs.  So the
net result is that in about half the cases, such comments are placed
one tab stop left of before.  This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.

Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.

This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.

Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
This commit is contained in:
Tom Lane 2017-06-21 15:18:54 -04:00
parent f669c09989
commit c7b8998ebb
1107 changed files with 3433 additions and 3514 deletions

View File

@ -101,8 +101,8 @@ typedef struct BloomOptions
{
int32 vl_len_; /* varlena header (do not touch directly!) */
int bloomLength; /* length of signature in words (not bits!) */
int bitSize[INDEX_MAX_KEYS]; /* # of bits generated for
* each index key */
int bitSize[INDEX_MAX_KEYS]; /* # of bits generated for each
* index key */
} BloomOptions;
/*

View File

@ -702,8 +702,8 @@ string2ean(const char *str, bool errorOK, ean13 *result,
last = (*(aux2 + 1) == '!' || *(aux2 + 1) == '\0'); /* is the last character */
digit = (isdigit((unsigned char) *aux2) != 0); /* is current character
* a digit? */
if (*aux2 == '?' && last) /* automagically calculate check digit
* if it's '?' */
if (*aux2 == '?' && last) /* automagically calculate check digit if
* it's '?' */
magic = digit = true;
if (length == 0 && (*aux2 == 'M' || *aux2 == 'm'))
{
@ -832,8 +832,8 @@ string2ean(const char *str, bool errorOK, ean13 *result,
goto eanwrongtype;
break;
case ISMN:
memcpy(buf, "9790", 4); /* this isn't for sure yet, for now
* ISMN it's only 9790 */
memcpy(buf, "9790", 4); /* this isn't for sure yet, for now ISMN
* it's only 9790 */
valid = (valid && ((rcheck = checkdig(buf, 13)) == check || magic));
break;
case ISBN:

View File

@ -59,8 +59,8 @@ char *restartWALFileName; /* the file from which we can restart restore */
char *priorWALFileName; /* the file we need to get from archive */
char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */
char restoreCommand[MAXPGPATH]; /* run this to restore */
char exclusiveCleanupFileName[MAXFNAMELEN]; /* the file we need to
* get from archive */
char exclusiveCleanupFileName[MAXFNAMELEN]; /* the file we need to get
* from archive */
/*
* Two types of failover are supported (smart and fast failover).

View File

@ -70,8 +70,8 @@ static fmgr_hook_type next_fmgr_hook = NULL;
static char *client_label_peer = NULL; /* set by getpeercon(3) */
static List *client_label_pending = NIL; /* pending list being set by
* sepgsql_setcon() */
static char *client_label_committed = NULL; /* set by sepgsql_setcon(),
* and already committed */
static char *client_label_committed = NULL; /* set by sepgsql_setcon(), and
* already committed */
static char *client_label_func = NULL; /* set by trusted procedure */
typedef struct

View File

@ -31,8 +31,7 @@
typedef struct
{
TransactionId new_prune_xid; /* new prune hint value for page */
TransactionId latestRemovedXid; /* latest xid to be removed by this
* prune */
TransactionId latestRemovedXid; /* latest xid to be removed by this prune */
int nredirected; /* numbers of entries in arrays below */
int ndead;
int nunused;

View File

@ -147,12 +147,12 @@ typedef struct RewriteStateData
bool rs_buffer_valid; /* T if any tuples in buffer */
bool rs_use_wal; /* must we WAL-log inserts? */
bool rs_logical_rewrite; /* do we need to do logical rewriting */
TransactionId rs_oldest_xmin; /* oldest xmin used by caller to
* determine tuple visibility */
TransactionId rs_oldest_xmin; /* oldest xmin used by caller to determine
* tuple visibility */
TransactionId rs_freeze_xid; /* Xid that will be used as freeze cutoff
* point */
TransactionId rs_logical_xmin; /* Xid that will be used as cutoff
* point for logical rewrites */
TransactionId rs_logical_xmin; /* Xid that will be used as cutoff point
* for logical rewrites */
MultiXactId rs_cutoff_multi; /* MultiXactId that will be used as cutoff
* point for multixacts */
MemoryContext rs_cxt; /* for hash tables and entries and tuples in
@ -216,8 +216,8 @@ typedef struct RewriteMappingFile
*/
typedef struct RewriteMappingDataEntry
{
LogicalRewriteMappingData map; /* map between old and new location of
* the tuple */
LogicalRewriteMappingData map; /* map between old and new location of the
* tuple */
dlist_node node;
} RewriteMappingDataEntry;

View File

@ -95,9 +95,8 @@ typedef struct BTParallelScanDescData
BTPS_State btps_pageStatus; /* indicates whether next page is
* available for scan. see above for
* possible states of parallel scan. */
int btps_arrayKeyCount; /* count indicating number of array
* scan keys processed by parallel
* scan */
int btps_arrayKeyCount; /* count indicating number of array scan
* keys processed by parallel scan */
slock_t btps_mutex; /* protects above variables */
ConditionVariable btps_cv; /* used to synchronize parallel scan */
} BTParallelScanDescData;

View File

@ -2641,8 +2641,7 @@ CleanupTransaction(void)
* do abort cleanup processing
*/
AtCleanup_Portals(); /* now safe to release portal memory */
AtEOXact_Snapshot(false, true); /* and release the transaction's
* snapshots */
AtEOXact_Snapshot(false, true); /* and release the transaction's snapshots */
CurrentResourceOwner = NULL; /* and resource owner */
if (TopTransactionResourceOwner)

View File

@ -582,8 +582,7 @@ typedef struct XLogCtlData
XLogRecPtr asyncXactLSN; /* LSN of newest async commit/abort */
XLogRecPtr replicationSlotMinLSN; /* oldest LSN needed by any slot */
XLogSegNo lastRemovedSegNo; /* latest removed/recycled XLOG
* segment */
XLogSegNo lastRemovedSegNo; /* latest removed/recycled XLOG segment */
/* Fake LSN counter, for unlogged relations. Protected by ulsn_lck. */
XLogRecPtr unloggedLSN;

View File

@ -62,8 +62,8 @@ typedef struct
static registered_buffer *registered_buffers;
static int max_registered_buffers; /* allocated size */
static int max_registered_block_id = 0; /* highest block_id + 1
* currently registered */
static int max_registered_block_id = 0; /* highest block_id + 1 currently
* registered */
/*
* A chain of XLogRecDatas to hold the "main data" of a WAL record, registered

View File

@ -97,19 +97,18 @@ typedef struct
Oid class_oid; /* oid of catalog */
Oid oid_index_oid; /* oid of index on system oid column */
int oid_catcache_id; /* id of catcache on system oid column */
int name_catcache_id; /* id of catcache on (name,namespace),
* or (name) if the object does not
* live in a namespace */
int name_catcache_id; /* id of catcache on (name,namespace), or
* (name) if the object does not live in a
* namespace */
AttrNumber attnum_name; /* attnum of name field */
AttrNumber attnum_namespace; /* attnum of namespace field */
AttrNumber attnum_owner; /* attnum of owner field */
AttrNumber attnum_acl; /* attnum of acl field */
AclObjectKind acl_kind; /* ACL_KIND_* of this object type */
bool is_nsp_name_unique; /* can the nsp/name combination (or
* name alone, if there's no
* namespace) be considered a unique
* identifier for an object of this
* class? */
bool is_nsp_name_unique; /* can the nsp/name combination (or name
* alone, if there's no namespace) be
* considered a unique identifier for an
* object of this class? */
} ObjectPropertyType;
static const ObjectPropertyType ObjectProperty[] =

View File

@ -619,8 +619,8 @@ AggregateCreate(const char *aggName,
* definable for agg) */
false, /* isLeakProof */
false, /* isStrict (not needed for agg) */
PROVOLATILE_IMMUTABLE, /* volatility (not
* needed for agg) */
PROVOLATILE_IMMUTABLE, /* volatility (not needed
* for agg) */
proparallel,
parameterTypes, /* paramTypes */
allParameterTypes, /* allParamTypes */

View File

@ -57,8 +57,8 @@ typedef struct EventTriggerQueryState
bool in_sql_drop;
/* table_rewrite */
Oid table_rewrite_oid; /* InvalidOid, or set for
* table_rewrite event */
Oid table_rewrite_oid; /* InvalidOid, or set for table_rewrite
* event */
int table_rewrite_reason; /* AT_REWRITE reason */
/* Support for command collection */

View File

@ -7337,8 +7337,7 @@ ATAddForeignKeyConstraint(AlteredTableInfo *tab, Relation rel,
RelationGetRelid(rel),
fkattnum,
numfks,
InvalidOid, /* not a domain
* constraint */
InvalidOid, /* not a domain constraint */
indexOid,
RelationGetRelid(pkrel),
pkattnum,

View File

@ -3255,8 +3255,7 @@ typedef SetConstraintStateData *SetConstraintState;
*/
typedef uint32 TriggerFlags;
#define AFTER_TRIGGER_OFFSET 0x0FFFFFFF /* must be low-order
* bits */
#define AFTER_TRIGGER_OFFSET 0x0FFFFFFF /* must be low-order bits */
#define AFTER_TRIGGER_DONE 0x10000000
#define AFTER_TRIGGER_IN_PROGRESS 0x20000000
/* bits describing the size and tuple sources of this event */

View File

@ -86,8 +86,7 @@ CreateRole(ParseState *pstate, CreateRoleStmt *stmt)
bool createdb = false; /* Can the user create databases? */
bool canlogin = false; /* Can this user login? */
bool isreplication = false; /* Is this a replication role? */
bool bypassrls = false; /* Is this a row security enabled
* role? */
bool bypassrls = false; /* Is this a row security enabled role? */
int connlimit = -1; /* maximum connections allowed */
List *addroleto = NIL; /* roles to make this a member of */
List *rolemembers = NIL; /* roles to be members of this role */

View File

@ -2373,8 +2373,7 @@ agg_retrieve_direct(AggState *aggstate)
firstSlot,
InvalidBuffer,
true);
aggstate->grp_firstTuple = NULL; /* don't keep two
* pointers */
aggstate->grp_firstTuple = NULL; /* don't keep two pointers */
/* set up for first advance_aggregates call */
tmpcontext->ecxt_outertuple = firstSlot;

View File

@ -1561,8 +1561,7 @@ ExecModifyTable(ModifyTableState *node)
elog(ERROR, "ctid is NULL");
tupleid = (ItemPointer) DatumGetPointer(datum);
tuple_ctid = *tupleid; /* be sure we don't free
* ctid!! */
tuple_ctid = *tupleid; /* be sure we don't free ctid!! */
tupleid = &tuple_ctid;
}

View File

@ -446,8 +446,7 @@ _readRangeVar(void)
{
READ_LOCALS(RangeVar);
local_node->catalogname = NULL; /* not currently saved in output
* format */
local_node->catalogname = NULL; /* not currently saved in output format */
READ_STRING_FIELD(schemaname);
READ_STRING_FIELD(relname);

View File

@ -1214,8 +1214,7 @@ create_append_path(RelOptInfo *rel, List *subpaths, Relids required_outer,
pathnode->path.parallel_aware = false;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = parallel_workers;
pathnode->path.pathkeys = NIL; /* result is always considered
* unsorted */
pathnode->path.pathkeys = NIL; /* result is always considered unsorted */
pathnode->partitioned_rels = list_copy(partitioned_rels);
pathnode->subpaths = subpaths;

View File

@ -205,8 +205,7 @@ CheckpointerMain(void)
* want to wait for the backends to exit, whereupon the postmaster will
* tell us it's okay to shut down (via SIGUSR2).
*/
pqsignal(SIGHUP, ChkptSigHupHandler); /* set flag to read config
* file */
pqsignal(SIGHUP, ChkptSigHupHandler); /* set flag to read config file */
pqsignal(SIGINT, ReqCheckpointHandler); /* request checkpoint */
pqsignal(SIGTERM, SIG_IGN); /* ignore SIGTERM */
pqsignal(SIGQUIT, chkpt_quickdie); /* hard crash time */

View File

@ -55,8 +55,7 @@
* ----------
*/
#define PGARCH_AUTOWAKE_INTERVAL 60 /* How often to force a poll of the
* archive status directory; in
* seconds. */
* archive status directory; in seconds. */
#define PGARCH_RESTART_INTERVAL 10 /* How often to attempt to restart a
* failed archiver; in seconds. */

View File

@ -77,14 +77,14 @@
#define PGSTAT_STAT_INTERVAL 500 /* Minimum time between stats file
* updates; in milliseconds. */
#define PGSTAT_RETRY_DELAY 10 /* How long to wait between checks for
* a new file; in milliseconds. */
#define PGSTAT_RETRY_DELAY 10 /* How long to wait between checks for a
* new file; in milliseconds. */
#define PGSTAT_MAX_WAIT_TIME 10000 /* Maximum time to wait for a stats
* file update; in milliseconds. */
#define PGSTAT_INQ_INTERVAL 640 /* How often to ping the collector for
* a new file; in milliseconds. */
#define PGSTAT_INQ_INTERVAL 640 /* How often to ping the collector for a
* new file; in milliseconds. */
#define PGSTAT_RESTART_INTERVAL 60 /* How often to attempt to restart a
* failed statistics collector; in

View File

@ -631,13 +631,11 @@ PostmasterMain(int argc, char *argv[])
pqinitmask();
PG_SETMASK(&BlockSig);
pqsignal_no_restart(SIGHUP, SIGHUP_handler); /* reread config file
* and have children do
* same */
pqsignal_no_restart(SIGHUP, SIGHUP_handler); /* reread config file and
* have children do same */
pqsignal_no_restart(SIGINT, pmdie); /* send SIGTERM and shut down */
pqsignal_no_restart(SIGQUIT, pmdie); /* send SIGQUIT and die */
pqsignal_no_restart(SIGTERM, pmdie); /* wait for children and shut
* down */
pqsignal_no_restart(SIGTERM, pmdie); /* wait for children and shut down */
pqsignal(SIGALRM, SIG_IGN); /* ignored */
pqsignal(SIGPIPE, SIG_IGN); /* ignored */
pqsignal_no_restart(SIGUSR1, sigusr1_handler); /* message from child

View File

@ -1040,8 +1040,7 @@ static void
colorcomplement(struct nfa *nfa,
struct colormap *cm,
int type,
struct state *of, /* complements of this guy's PLAIN
* outarcs */
struct state *of, /* complements of this guy's PLAIN outarcs */
struct state *from,
struct state *to)
{

View File

@ -124,8 +124,8 @@ typedef struct ReorderBufferToastEnt
Size num_chunks; /* number of chunks we've already seen */
Size size; /* combined size of chunks seen */
dlist_head chunks; /* linked list of chunks */
struct varlena *reconstructed; /* reconstructed varlena now pointed
* to in main tup */
struct varlena *reconstructed; /* reconstructed varlena now pointed to in
* main tup */
} ReorderBufferToastEnt;
/* Disk serialization support datastructures */

View File

@ -259,8 +259,7 @@ WalReceiverMain(void)
walrcv->latch = &MyProc->procLatch;
/* Properly accept or ignore signals the postmaster might send us */
pqsignal(SIGHUP, WalRcvSigHupHandler); /* set flag to read config
* file */
pqsignal(SIGHUP, WalRcvSigHupHandler); /* set flag to read config file */
pqsignal(SIGINT, SIG_IGN);
pqsignal(SIGTERM, WalRcvShutdownHandler); /* request shutdown */
pqsignal(SIGQUIT, WalRcvQuickDieHandler); /* hard crash time */

View File

@ -112,15 +112,15 @@ WalSnd *MyWalSnd = NULL;
/* Global state */
bool am_walsender = false; /* Am I a walsender process? */
bool am_cascading_walsender = false; /* Am I cascading WAL to
* another standby? */
bool am_cascading_walsender = false; /* Am I cascading WAL to another
* standby? */
bool am_db_walsender = false; /* Connected to a database? */
/* User-settable parameters for walsender */
int max_wal_senders = 0; /* the maximum number of concurrent
* walsenders */
int wal_sender_timeout = 60 * 1000; /* maximum time to send one
* WAL data message */
int wal_sender_timeout = 60 * 1000; /* maximum time to send one WAL
* data message */
bool log_replication_commands = false;
/*

View File

@ -3640,8 +3640,8 @@ PostgresMain(int argc, char *argv[],
WalSndSignals();
else
{
pqsignal(SIGHUP, PostgresSigHupHandler); /* set flag to read
* config file */
pqsignal(SIGHUP, PostgresSigHupHandler); /* set flag to read config
* file */
pqsignal(SIGINT, StatementCancelHandler); /* cancel current query */
pqsignal(SIGTERM, die); /* cancel current query and exit */

View File

@ -84,8 +84,7 @@ CreateQueryDesc(PlannedStmt *plannedstmt,
qd->dest = dest; /* output dest */
qd->params = params; /* parameter values passed into query */
qd->queryEnv = queryEnv;
qd->instrument_options = instrument_options; /* instrumentation
* wanted? */
qd->instrument_options = instrument_options; /* instrumentation wanted? */
/* null these fields until set by ExecutorStart */
qd->tupDesc = NULL;

View File

@ -4963,8 +4963,7 @@ initArrayResult(Oid element_type, MemoryContext rcontext, bool subcontext)
MemoryContextAlloc(arr_context, sizeof(ArrayBuildState));
astate->mcontext = arr_context;
astate->private_cxt = subcontext;
astate->alen = (subcontext ? 64 : 8); /* arbitrary starting array
* size */
astate->alen = (subcontext ? 64 : 8); /* arbitrary starting array size */
astate->dvalues = (Datum *)
MemoryContextAlloc(arr_context, astate->alen * sizeof(Datum));
astate->dnulls = (bool *)
@ -5140,8 +5139,7 @@ initArrayResultArr(Oid array_type, Oid element_type, MemoryContext rcontext,
bool subcontext)
{
ArrayBuildStateArr *astate;
MemoryContext arr_context = rcontext; /* by default use the parent
* ctx */
MemoryContext arr_context = rcontext; /* by default use the parent ctx */
/* Lookup element type, unless element_type already provided */
if (!OidIsValid(element_type))

View File

@ -2826,8 +2826,8 @@ close_ps(PG_FUNCTION_ARGS)
* "band" */
if (pt->y < (tmp->A * pt->x + tmp->C))
{ /* we are below the lower edge */
result = point_copy(&lseg->p[!yh]); /* below the lseg, take lower
* end pt */
result = point_copy(&lseg->p[!yh]); /* below the lseg, take lower end
* pt */
#ifdef GEODEBUG
printf("close_ps below: tmp A %f B %f C %f\n",
tmp->A, tmp->B, tmp->C);
@ -2838,8 +2838,8 @@ close_ps(PG_FUNCTION_ARGS)
* "band" */
if (pt->y > (tmp->A * pt->x + tmp->C))
{ /* we are below the lower edge */
result = point_copy(&lseg->p[yh]); /* above the lseg, take higher
* end pt */
result = point_copy(&lseg->p[yh]); /* above the lseg, take higher end
* pt */
#ifdef GEODEBUG
printf("close_ps above: tmp A %f B %f C %f\n",
tmp->A, tmp->B, tmp->C);

View File

@ -57,8 +57,8 @@ typedef struct OkeysState
typedef struct IterateJsonStringValuesState
{
JsonLexContext *lex;
JsonIterateStringValuesAction action; /* an action that will be
* applied to each json value */
JsonIterateStringValuesAction action; /* an action that will be applied
* to each json value */
void *action_state; /* any necessary context for iteration */
} IterateJsonStringValuesState;
@ -67,8 +67,8 @@ typedef struct TransformJsonStringValuesState
{
JsonLexContext *lex;
StringInfo strval; /* resulting json */
JsonTransformStringValuesAction action; /* an action that will be
* applied to each json value */
JsonTransformStringValuesAction action; /* an action that will be applied
* to each json value */
void *action_state; /* any necessary context for transformation */
} TransformJsonStringValuesState;

View File

@ -200,8 +200,7 @@ namecpy(Name n1, Name n2)
int
namecat(Name n1, Name n2)
{
return namestrcat(n1, NameStr(*n2)); /* n2 can't be any longer than
* n1 */
return namestrcat(n1, NameStr(*n2)); /* n2 can't be any longer than n1 */
}
#endif

View File

@ -121,12 +121,9 @@ typedef struct RI_ConstraintInfo
int nkeys; /* number of key columns */
int16 pk_attnums[RI_MAX_NUMKEYS]; /* attnums of referenced cols */
int16 fk_attnums[RI_MAX_NUMKEYS]; /* attnums of referencing cols */
Oid pf_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK =
* FK) */
Oid pp_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK =
* PK) */
Oid ff_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (FK =
* FK) */
Oid pf_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK = FK) */
Oid pp_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK = PK) */
Oid ff_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (FK = FK) */
dlist_node valid_link; /* Link in list of valid entries */
} RI_ConstraintInfo;

View File

@ -113,8 +113,8 @@ typedef struct
int wrapColumn; /* max line length, or -1 for no limit */
int indentLevel; /* current indent level for prettyprint */
bool varprefix; /* TRUE to print prefixes on Vars */
ParseExprKind special_exprkind; /* set only for exprkinds needing
* special handling */
ParseExprKind special_exprkind; /* set only for exprkinds needing special
* handling */
} deparse_context;
/*

View File

@ -5931,8 +5931,7 @@ regex_selectivity_sub(const char *patt, int pattlen, bool case_insensitive)
negclass = true;
pos++;
}
if (patt[pos] == ']') /* ']' at start of class is not
* special */
if (patt[pos] == ']') /* ']' at start of class is not special */
pos++;
while (pos < pattlen && patt[pos] != ']')
pos++;

View File

@ -234,8 +234,8 @@ gettoken_query(TSQueryParserState state,
case WAITOPERAND:
if (t_iseq(state->buf, '!'))
{
(state->buf)++; /* can safely ++, t_iseq guarantee
* that pg_mblen()==1 */
(state->buf)++; /* can safely ++, t_iseq guarantee that
* pg_mblen()==1 */
*operator = OP_NOT;
state->state = WAITOPERAND;
return PT_OPR;

View File

@ -111,8 +111,7 @@ get_attribute_options(Oid attrelid, int attnum)
/* Find existing cache entry, if any. */
if (!AttoptCacheHash)
InitializeAttoptCache();
memset(&key, 0, sizeof(key)); /* make sure any padding bits are
* unset */
memset(&key, 0, sizeof(key)); /* make sure any padding bits are unset */
key.attrelid = attrelid;
key.attnum = attnum;
attopt =

View File

@ -438,8 +438,8 @@ bool Debug_pretty_print = true;
bool log_parser_stats = false;
bool log_planner_stats = false;
bool log_executor_stats = false;
bool log_statement_stats = false; /* this is sort of all three
* above together */
bool log_statement_stats = false; /* this is sort of all three above
* together */
bool log_btree_build_stats = false;
char *event_source;

View File

@ -85,8 +85,7 @@ typedef struct OldSnapshotControlData
*/
slock_t mutex_current; /* protect current_timestamp */
TimestampTz current_timestamp; /* latest snapshot timestamp */
slock_t mutex_latest_xmin; /* protect latest_xmin and
* next_map_update */
slock_t mutex_latest_xmin; /* protect latest_xmin and next_map_update */
TransactionId latest_xmin; /* latest snapshot xmin */
TimestampTz next_map_update; /* latest snapshot valid up to */
slock_t mutex_threshold; /* protect threshold fields */

View File

@ -33,9 +33,8 @@ char *additional_ext = NULL; /* Extension to remove from filenames */
char *archiveLocation; /* where to find the archive? */
char *restartWALFileName; /* the file from which we can restart restore */
char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */
char exclusiveCleanupFileName[MAXFNAMELEN]; /* the oldest file we
* want to remain in
* archive */
char exclusiveCleanupFileName[MAXFNAMELEN]; /* the oldest file we want
* to remain in archive */
/* =====================================================================

View File

@ -33,8 +33,7 @@ typedef struct StreamCtl
TimeLineID timeline; /* Timeline to stream data from */
char *sysidentifier; /* Validate this system identifier and
* timeline */
int standby_message_timeout; /* Send status messages this
* often */
int standby_message_timeout; /* Send status messages this often */
bool synchronous; /* Flush immediately WAL data on write */
bool mark_done; /* Mark segment as done in generated archive */
bool do_sync; /* Flush to disk to ensure consistent state of

View File

@ -787,8 +787,7 @@ read_post_opts(void)
*/
if ((arg1 = strstr(optline, " \"")) != NULL)
{
*arg1 = '\0'; /* terminate so we get only program
* name */
*arg1 = '\0'; /* terminate so we get only program name */
post_opts = pg_strdup(arg1 + 1); /* point past whitespace */
}
if (exec_path == NULL)

View File

@ -189,8 +189,7 @@ typedef struct Archive
int maxRemoteVersion;
int numWorkers; /* number of parallel processes */
char *sync_snapshot_id; /* sync snapshot id for parallel
* operation */
char *sync_snapshot_id; /* sync snapshot id for parallel operation */
/* info needed for string escaping */
int encoding; /* libpq code for client_encoding */

View File

@ -217,8 +217,8 @@ struct _archiveHandle
char *archiveRemoteVersion; /* When reading an archive, the
* version of the dumped DB */
char *archiveDumpVersion; /* When reading an archive, the
* version of the dumper */
char *archiveDumpVersion; /* When reading an archive, the version of
* the dumper */
int debugLevel; /* Used for logging (currently only by
* --verbose) */
@ -242,12 +242,11 @@ struct _archiveHandle
size_t lookaheadLen; /* Length of data in lookahead */
pgoff_t lookaheadPos; /* Current read position in lookahead buffer */
ArchiveEntryPtrType ArchiveEntryPtr; /* Called for each metadata
* object */
StartDataPtrType StartDataPtr; /* Called when table data is about to
* be dumped */
WriteDataPtrType WriteDataPtr; /* Called to send some table data to
* the archive */
ArchiveEntryPtrType ArchiveEntryPtr; /* Called for each metadata object */
StartDataPtrType StartDataPtr; /* Called when table data is about to be
* dumped */
WriteDataPtrType WriteDataPtr; /* Called to send some table data to the
* archive */
EndDataPtrType EndDataPtr; /* Called when table data dump is finished */
WriteBytePtrType WriteBytePtr; /* Write a byte to output */
ReadBytePtrType ReadBytePtr; /* Read a byte from an archive */
@ -258,8 +257,8 @@ struct _archiveHandle
WriteExtraTocPtrType WriteExtraTocPtr; /* Write extra TOC entry data
* associated with the current
* archive format */
ReadExtraTocPtrType ReadExtraTocPtr; /* Read extra info associated
* with archive format */
ReadExtraTocPtrType ReadExtraTocPtr; /* Read extra info associated with
* archive format */
PrintExtraTocPtrType PrintExtraTocPtr; /* Extra TOC info for format */
PrintTocDataPtrType PrintTocDataPtr;

View File

@ -145,8 +145,7 @@ typedef struct HashScanOpaqueData
*/
bool hashso_buc_split;
/* info about killed items if any (killedItems is NULL if never used) */
HashScanPosItem *killedItems; /* tids and offset numbers of killed
* items */
HashScanPosItem *killedItems; /* tids and offset numbers of killed items */
int numKilled; /* number of currently stored items */
} HashScanOpaqueData;
@ -218,8 +217,8 @@ typedef struct HashMetaPageData
uint32 hashm_firstfree; /* lowest-number free ovflpage (bit#) */
uint32 hashm_nmaps; /* number of bitmap pages */
RegProcedure hashm_procid; /* hash procedure id from pg_proc */
uint32 hashm_spares[HASH_MAX_SPLITPOINTS]; /* spare pages before
* each splitpoint */
uint32 hashm_spares[HASH_MAX_SPLITPOINTS]; /* spare pages before each
* splitpoint */
BlockNumber hashm_mapp[HASH_MAX_BITMAPS]; /* blknos of ovfl bitmaps */
} HashMetaPageData;

View File

@ -30,8 +30,7 @@
#define XLOG_HASH_ADD_OVFL_PAGE 0x30 /* add overflow page */
#define XLOG_HASH_SPLIT_ALLOCATE_PAGE 0x40 /* allocate new page for split */
#define XLOG_HASH_SPLIT_PAGE 0x50 /* split page */
#define XLOG_HASH_SPLIT_COMPLETE 0x60 /* completion of split
* operation */
#define XLOG_HASH_SPLIT_COMPLETE 0x60 /* completion of split operation */
#define XLOG_HASH_MOVE_PAGE_CONTENTS 0x70 /* remove tuples from one page
* and add to another page */
#define XLOG_HASH_SQUEEZE_PAGE 0x80 /* add tuples to one of the previous
@ -41,11 +40,10 @@
#define XLOG_HASH_SPLIT_CLEANUP 0xA0 /* clear split-cleanup flag in primary
* bucket page after deleting tuples
* that are moved due to split */
#define XLOG_HASH_UPDATE_META_PAGE 0xB0 /* update meta page after
* vacuum */
#define XLOG_HASH_UPDATE_META_PAGE 0xB0 /* update meta page after vacuum */
#define XLOG_HASH_VACUUM_ONE_PAGE 0xC0 /* remove dead tuples from
* index page */
#define XLOG_HASH_VACUUM_ONE_PAGE 0xC0 /* remove dead tuples from index
* page */
/*
* xl_hash_split_allocate_page flag values, 8 bits are available.
@ -180,9 +178,9 @@ typedef struct xl_hash_squeeze_page
* tuples are moved is same as
* primary bucket page */
bool is_prev_bucket_same_wrt; /* TRUE if the page to which
* tuples are moved is the
* page previous to the freed
* overflow page */
* tuples are moved is the page
* previous to the freed overflow
* page */
} xl_hash_squeeze_page;
#define SizeOfHashSqueezePage \

View File

@ -119,8 +119,7 @@ typedef ScanKeyData *ScanKey;
#define SK_ROW_END 0x0010 /* last row comparison member */
#define SK_SEARCHARRAY 0x0020 /* scankey represents ScalarArrayOp */
#define SK_SEARCHNULL 0x0040 /* scankey represents "col IS NULL" */
#define SK_SEARCHNOTNULL 0x0080 /* scankey represents "col IS NOT
* NULL" */
#define SK_SEARCHNOTNULL 0x0080 /* scankey represents "col IS NOT NULL" */
#define SK_ORDER_BY 0x0100 /* scankey is for ORDER BY op */

View File

@ -94,8 +94,8 @@ typedef struct spgChooseOut
bool prefixHasPrefix; /* tuple should have a prefix? */
Datum prefixPrefixDatum; /* if so, its value */
int prefixNNodes; /* number of nodes */
Datum *prefixNodeLabels; /* their labels (or NULL for
* no labels) */
Datum *prefixNodeLabels; /* their labels (or NULL for no
* labels) */
int childNodeN; /* which node gets child tuple */
/* Info to form new lower-level inner tuple with all old nodes */
@ -137,8 +137,7 @@ typedef struct spgInnerConsistentIn
Datum reconstructedValue; /* value reconstructed at parent */
void *traversalValue; /* opclass-specific traverse value */
MemoryContext traversalMemoryContext; /* put new traverse values
* here */
MemoryContext traversalMemoryContext; /* put new traverse values here */
int level; /* current level (counting from zero) */
bool returnData; /* original data must be returned? */

View File

@ -25,8 +25,8 @@
/* Flags for bit map */
#define VISIBILITYMAP_ALL_VISIBLE 0x01
#define VISIBILITYMAP_ALL_FROZEN 0x02
#define VISIBILITYMAP_VALID_BITS 0x03 /* OR of all valid
* visibilitymap flags bits */
#define VISIBILITYMAP_VALID_BITS 0x03 /* OR of all valid visibilitymap
* flags bits */
/* Macros for visibilitymap test */
#define VM_ALL_VISIBLE(r, b, v) \

View File

@ -61,8 +61,7 @@ typedef enum
SYNCHRONOUS_COMMIT_REMOTE_WRITE, /* wait for local flush and remote
* write */
SYNCHRONOUS_COMMIT_REMOTE_FLUSH, /* wait for local and remote flush */
SYNCHRONOUS_COMMIT_REMOTE_APPLY /* wait for local flush and remote
* apply */
SYNCHRONOUS_COMMIT_REMOTE_APPLY /* wait for local flush and remote apply */
} SyncCommitLevel;
/* Define the default setting for synchronous_commit */

View File

@ -173,9 +173,8 @@ extern bool XLOG_DEBUG;
/* These directly affect the behavior of CreateCheckPoint and subsidiaries */
#define CHECKPOINT_IS_SHUTDOWN 0x0001 /* Checkpoint is for shutdown */
#define CHECKPOINT_END_OF_RECOVERY 0x0002 /* Like shutdown checkpoint,
* but issued at end of WAL
* recovery */
#define CHECKPOINT_END_OF_RECOVERY 0x0002 /* Like shutdown checkpoint, but
* issued at end of WAL recovery */
#define CHECKPOINT_IMMEDIATE 0x0004 /* Do it without delays */
#define CHECKPOINT_FORCE 0x0008 /* Force even if no activity */
#define CHECKPOINT_FLUSH_ALL 0x0010 /* Flush all pages, including those
@ -212,8 +211,8 @@ typedef struct CheckpointStatsData
uint64 ckpt_longest_sync; /* Longest sync for one relation */
uint64 ckpt_agg_sync_time; /* The sum of all the individual sync
* times, which is not necessarily the
* same as the total elapsed time for
* the entire sync phase. */
* same as the total elapsed time for the
* entire sync phase. */
} CheckpointStatsData;
extern CheckpointStatsData CheckpointStats;

View File

@ -29,9 +29,8 @@
/* flags for XLogRegisterBuffer */
#define REGBUF_FORCE_IMAGE 0x01 /* force a full-page image */
#define REGBUF_NO_IMAGE 0x02 /* don't take a full-page image */
#define REGBUF_WILL_INIT (0x04 | 0x02) /* page will be re-initialized
* at replay (implies
* NO_IMAGE) */
#define REGBUF_WILL_INIT (0x04 | 0x02) /* page will be re-initialized at
* replay (implies NO_IMAGE) */
#define REGBUF_STANDARD 0x08 /* page follows "standard" page layout,
* (data between pd_lower and pd_upper
* will be skipped) */

View File

@ -49,8 +49,7 @@ CATALOG(pg_init_privs,3394) BKI_WITHOUT_OIDS
char privtype; /* from initdb or extension? */
#ifdef CATALOG_VARLEN /* variable-length fields start here */
aclitem initprivs[1] BKI_FORCE_NOT_NULL; /* initial privs on
* object */
aclitem initprivs[1] BKI_FORCE_NOT_NULL; /* initial privs on object */
#endif
} FormData_pg_init_privs;

View File

@ -28,8 +28,7 @@ CATALOG(pg_seclabel,3596) BKI_WITHOUT_OIDS
#ifdef CATALOG_VARLEN /* variable-length fields start here */
text provider BKI_FORCE_NOT_NULL; /* name of label provider */
text label BKI_FORCE_NOT_NULL; /* security label of the
* object */
text label BKI_FORCE_NOT_NULL; /* security label of the object */
#endif
} FormData_pg_seclabel;

View File

@ -28,8 +28,7 @@ CATALOG(pg_shseclabel,3592) BKI_SHARED_RELATION BKI_ROWTYPE_OID(4066) BKI_WITHOU
#ifdef CATALOG_VARLEN /* variable-length fields start here */
text provider BKI_FORCE_NOT_NULL; /* name of label provider */
text label BKI_FORCE_NOT_NULL; /* security label of the
* object */
text label BKI_FORCE_NOT_NULL; /* security label of the object */
#endif
} FormData_pg_shseclabel;

View File

@ -54,8 +54,8 @@ typedef FormData_pg_subscription_rel *Form_pg_subscription_rel;
#define SUBREL_STATE_INIT 'i' /* initializing (sublsn NULL) */
#define SUBREL_STATE_DATASYNC 'd' /* data is being synchronized (sublsn
* NULL) */
#define SUBREL_STATE_SYNCDONE 's' /* synchronization finished in front
* of apply (sublsn set) */
#define SUBREL_STATE_SYNCDONE 's' /* synchronization finished in front of
* apply (sublsn set) */
#define SUBREL_STATE_READY 'r' /* ready (sublsn set) */
/* These are never stored in the catalog, we only use them for IPC. */

View File

@ -137,19 +137,18 @@ typedef struct VacuumParams
{
int freeze_min_age; /* min freeze age, -1 to use default */
int freeze_table_age; /* age at which to scan whole table */
int multixact_freeze_min_age; /* min multixact freeze age,
* -1 to use default */
int multixact_freeze_table_age; /* multixact age at which to
* scan whole table */
int multixact_freeze_min_age; /* min multixact freeze age, -1 to
* use default */
int multixact_freeze_table_age; /* multixact age at which to scan
* whole table */
bool is_wraparound; /* force a for-wraparound vacuum */
int log_min_duration; /* minimum execution threshold in ms
* at which verbose logs are
* activated, -1 to use default */
int log_min_duration; /* minimum execution threshold in ms at
* which verbose logs are activated, -1
* to use default */
} VacuumParams;
/* GUC parameters */
extern PGDLLIMPORT int default_statistics_target; /* PGDLLIMPORT for
* PostGIS */
extern PGDLLIMPORT int default_statistics_target; /* PGDLLIMPORT for PostGIS */
extern int vacuum_freeze_min_age;
extern int vacuum_freeze_table_age;
extern int vacuum_multixact_freeze_min_age;

View File

@ -128,8 +128,7 @@ typedef struct HashJoinTableData
int nbuckets; /* # buckets in the in-memory hash table */
int log2_nbuckets; /* its log2 (nbuckets must be a power of 2) */
int nbuckets_original; /* # buckets when starting the first
* hash */
int nbuckets_original; /* # buckets when starting the first hash */
int nbuckets_optimal; /* optimal # buckets (per batch) */
int log2_nbuckets_optimal; /* log2(nbuckets_optimal) */

View File

@ -77,8 +77,8 @@ typedef struct printTextFormat
const char *nl_right; /* right mark for newline */
const char *wrap_left; /* left mark after wrapped data */
const char *wrap_right; /* right mark for wrapped data */
bool wrap_right_border; /* use right-hand border for wrap
* marks when border=0? */
bool wrap_right_border; /* use right-hand border for wrap marks
* when border=0? */
} printTextFormat;
typedef enum unicode_linestyle
@ -167,8 +167,8 @@ typedef struct printQueryOpt
char *title; /* override title */
char **footers; /* override footer (default is "(xx rows)") */
bool translate_header; /* do gettext on column headers */
const bool *translate_columns; /* translate_columns[i-1] => do
* gettext on col i */
const bool *translate_columns; /* translate_columns[i-1] => do gettext on
* col i */
int n_translate_columns; /* length of translate_columns[] */
} printQueryOpt;

View File

@ -363,8 +363,8 @@ typedef struct
{
mb2wchar_with_len_converter mb2wchar_with_len; /* convert a multibyte
* string to a wchar */
wchar2mb_with_len_converter wchar2mb_with_len; /* convert a wchar
* string to a multibyte */
wchar2mb_with_len_converter wchar2mb_with_len; /* convert a wchar string
* to a multibyte */
mblen_converter mblen; /* get byte length of a char */
mbdisplaylen_converter dsplen; /* get display width of a char */
mbverifier mbverify; /* verify multibyte sequence */

View File

@ -691,8 +691,7 @@ typedef struct SetExprState
* output. If so, it's stored here.
*/
TupleDesc funcResultDesc;
bool funcReturnsTuple; /* valid when funcResultDesc isn't
* NULL */
bool funcReturnsTuple; /* valid when funcResultDesc isn't NULL */
/*
* Remember whether the function is declared to return a set. This is set
@ -930,13 +929,11 @@ typedef struct ModifyTableState
EPQState mt_epqstate; /* for evaluating EvalPlanQual rechecks */
bool fireBSTriggers; /* do we need to fire stmt triggers? */
OnConflictAction mt_onconflict; /* ON CONFLICT type */
List *mt_arbiterindexes; /* unique index OIDs to arbitrate
* taking alt path */
List *mt_arbiterindexes; /* unique index OIDs to arbitrate taking
* alt path */
TupleTableSlot *mt_existing; /* slot to store existing target tuple in */
List *mt_excludedtlist; /* the excluded pseudo relation's
* tlist */
TupleTableSlot *mt_conflproj; /* CONFLICT ... SET ... projection
* target */
List *mt_excludedtlist; /* the excluded pseudo relation's tlist */
TupleTableSlot *mt_conflproj; /* CONFLICT ... SET ... projection target */
struct PartitionDispatchData **mt_partition_dispatch_info;
/* Tuple-routing support info */
int mt_num_dispatch; /* Number of entries in the above array */
@ -1380,8 +1377,7 @@ typedef struct FunctionScanState
bool simple;
int64 ordinal;
int nfuncs;
struct FunctionScanPerFuncState *funcstates; /* array of length
* nfuncs */
struct FunctionScanPerFuncState *funcstates; /* array of length nfuncs */
MemoryContext argcontext;
} FunctionScanState;
@ -1760,8 +1756,7 @@ typedef struct AggState
int projected_set; /* The last projected grouping set */
int current_set; /* The current grouping set being evaluated */
Bitmapset *grouped_cols; /* grouped cols in current projection */
List *all_grouped_cols; /* list of all grouped cols in DESC
* order */
List *all_grouped_cols; /* list of all grouped cols in DESC order */
/* These fields are for grouping set phase data */
int maxsets; /* The max number of sets in any phase */
AggStatePerPhase phases; /* array of all phases */
@ -1810,8 +1805,7 @@ typedef struct WindowAggState
int64 frameheadpos; /* current frame head position */
int64 frametailpos; /* current frame tail position */
/* use struct pointer to avoid including windowapi.h here */
struct WindowObjectData *agg_winobj; /* winobj for aggregate
* fetches */
struct WindowObjectData *agg_winobj; /* winobj for aggregate fetches */
int64 aggregatedbase; /* start row for current aggregates */
int64 aggregatedupto; /* rows before this one are aggregated */
@ -1828,9 +1822,8 @@ typedef struct WindowAggState
bool all_first; /* true if the scan is starting */
bool all_done; /* true if the scan is finished */
bool partition_spooled; /* true if all tuples in current
* partition have been spooled into
* tuplestore */
bool partition_spooled; /* true if all tuples in current partition
* have been spooled into tuplestore */
bool more_partitions; /* true if there's more partitions after
* this one */
bool framehead_valid; /* true if frameheadpos is known up to
@ -1910,8 +1903,7 @@ typedef struct GatherMergeState
bool need_to_scan_locally;
int gm_nkeys;
SortSupport gm_sortkeys; /* array of length ms_nkeys */
struct GMReaderTupleBuffer *gm_tuple_buffers; /* tuple buffer per
* reader */
struct GMReaderTupleBuffer *gm_tuple_buffers; /* tuple buffer per reader */
} GatherMergeState;
/* ----------------

View File

@ -166,10 +166,9 @@ typedef struct Query
List *constraintDeps; /* a list of pg_constraint OIDs that the query
* depends on to be semantically valid */
List *withCheckOptions; /* a list of WithCheckOption's, which
* are only added during rewrite and
* therefore are not written out as
* part of Query. */
List *withCheckOptions; /* a list of WithCheckOption's, which are
* only added during rewrite and therefore
* are not written out as part of Query. */
/*
* The following two fields identify the portion of the source text string
@ -1863,9 +1862,9 @@ typedef struct ObjectWithArgs
NodeTag type;
List *objname; /* qualified name of function/operator */
List *objargs; /* list of Typename nodes */
bool args_unspecified; /* argument list was omitted, so name
* must be unique (note that objargs
* == NIL means zero args) */
bool args_unspecified; /* argument list was omitted, so name must
* be unique (note that objargs == NIL
* means zero args) */
} ObjectWithArgs;
/*

View File

@ -600,8 +600,7 @@ typedef struct ForeignScan
List *fdw_exprs; /* expressions that FDW may evaluate */
List *fdw_private; /* private data for FDW */
List *fdw_scan_tlist; /* optional tlist describing scan tuple */
List *fdw_recheck_quals; /* original quals not in
* scan.plan.qual */
List *fdw_recheck_quals; /* original quals not in scan.plan.qual */
Bitmapset *fs_relids; /* RTIs generated by this scan */
bool fsSystemCol; /* true if any "system column" is needed */
} ForeignScan;
@ -629,8 +628,7 @@ typedef struct CustomScan
List *custom_plans; /* list of Plan nodes, if any */
List *custom_exprs; /* expressions that custom code may evaluate */
List *custom_private; /* private data for custom code */
List *custom_scan_tlist; /* optional tlist describing scan
* tuple */
List *custom_scan_tlist; /* optional tlist describing scan tuple */
Bitmapset *custom_relids; /* RTIs generated by this scan */
const struct CustomScanMethods *methods;
} CustomScan;

View File

@ -692,8 +692,8 @@ typedef struct SubPlan
/* Extra data useful for determining subplan's output type: */
Oid firstColType; /* Type of first column of subplan result */
int32 firstColTypmod; /* Typmod of first column of subplan result */
Oid firstColCollation; /* Collation of first column of
* subplan result */
Oid firstColCollation; /* Collation of first column of subplan
* result */
/* Information about execution strategy: */
bool useHashTable; /* TRUE to store subselect output in a hash
* table (implies we are doing "IN") */

View File

@ -229,23 +229,23 @@ typedef struct PlannerInfo
List *cte_plan_ids; /* per-CTE-item list of subplan IDs */
List *multiexpr_params; /* List of Lists of Params for
* MULTIEXPR subquery outputs */
List *multiexpr_params; /* List of Lists of Params for MULTIEXPR
* subquery outputs */
List *eq_classes; /* list of active EquivalenceClasses */
List *canon_pathkeys; /* list of "canonical" PathKeys */
List *left_join_clauses; /* list of RestrictInfos for
* mergejoinable outer join clauses
* w/nonnullable var on left */
List *left_join_clauses; /* list of RestrictInfos for mergejoinable
* outer join clauses w/nonnullable var on
* left */
List *right_join_clauses; /* list of RestrictInfos for
* mergejoinable outer join clauses
* w/nonnullable var on right */
List *right_join_clauses; /* list of RestrictInfos for mergejoinable
* outer join clauses w/nonnullable var on
* right */
List *full_join_clauses; /* list of RestrictInfos for
* mergejoinable full join clauses */
List *full_join_clauses; /* list of RestrictInfos for mergejoinable
* full join clauses */
List *join_info_list; /* list of SpecialJoinInfos */
@ -582,8 +582,7 @@ typedef struct RelOptInfo
List *non_unique_for_rels; /* known not unique for these set(s) */
/* used by various scans and joins: */
List *baserestrictinfo; /* RestrictInfo structures (if base
* rel) */
List *baserestrictinfo; /* RestrictInfo structures (if base rel) */
QualCost baserestrictcost; /* cost of evaluating the above */
Index baserestrict_min_security; /* min security_level found in
* baserestrictinfo */
@ -959,8 +958,7 @@ typedef struct Path
bool parallel_aware; /* engage parallel-aware logic? */
bool parallel_safe; /* OK to use as part of parallel plan? */
int parallel_workers; /* desired # of workers; 0 = not
* parallel */
int parallel_workers; /* desired # of workers; 0 = not parallel */
/* estimated size/costs for path (see costsize.c for more info) */
double rows; /* estimated number of result tuples */

View File

@ -189,11 +189,10 @@ struct ParseState
List *p_locking_clause; /* raw FOR UPDATE/FOR SHARE info */
bool p_locked_from_parent; /* parent has marked this subquery
* with FOR UPDATE/FOR SHARE */
bool p_resolve_unknowns; /* resolve unknown-type SELECT outputs
* as type text */
bool p_resolve_unknowns; /* resolve unknown-type SELECT outputs as
* type text */
QueryEnvironment *p_queryEnv; /* curr env, incl refs to enclosing
* env */
QueryEnvironment *p_queryEnv; /* curr env, incl refs to enclosing env */
/* Flags telling about things found in the query: */
bool p_hasAggs;

View File

@ -64,8 +64,8 @@
#define BM_JUST_DIRTIED (1U << 28) /* dirtied since write started */
#define BM_PIN_COUNT_WAITER (1U << 29) /* have waiter for sole pin */
#define BM_CHECKPOINT_NEEDED (1U << 30) /* must write for checkpoint */
#define BM_PERMANENT (1U << 31) /* permanent buffer (not
* unlogged, or init fork) */
#define BM_PERMANENT (1U << 31) /* permanent buffer (not unlogged,
* or init fork) */
/*
* The maximum allowed value of usage_count represents a tradeoff between
* accuracy and speed of the clock-sweep buffer management algorithm. A

View File

@ -174,8 +174,7 @@ typedef PageHeaderData *PageHeader;
* Again, this is just a hint.
*/
#define PD_HAS_FREE_LINES 0x0001 /* are there any unused line pointers? */
#define PD_PAGE_FULL 0x0002 /* not enough free space for new
* tuple? */
#define PD_PAGE_FULL 0x0002 /* not enough free space for new tuple? */
#define PD_ALL_VISIBLE 0x0004 /* all tuples on page are visible to
* everyone */

View File

@ -63,8 +63,7 @@ extern bool Debug_deadlocks;
typedef struct
{
BackendId backendId; /* determined at backend startup */
LocalTransactionId localTransactionId; /* backend-local transaction
* id */
LocalTransactionId localTransactionId; /* backend-local transaction id */
} VirtualTransactionId;
#define InvalidLocalTransactionId 0

View File

@ -36,15 +36,14 @@ typedef int LOCKMODE;
#define AccessShareLock 1 /* SELECT */
#define RowShareLock 2 /* SELECT FOR UPDATE/FOR SHARE */
#define RowExclusiveLock 3 /* INSERT, UPDATE, DELETE */
#define ShareUpdateExclusiveLock 4 /* VACUUM (non-FULL),ANALYZE, CREATE
* INDEX CONCURRENTLY */
#define ShareUpdateExclusiveLock 4 /* VACUUM (non-FULL),ANALYZE, CREATE INDEX
* CONCURRENTLY */
#define ShareLock 5 /* CREATE INDEX (WITHOUT CONCURRENTLY) */
#define ShareRowExclusiveLock 6 /* like EXCLUSIVE MODE, but allows ROW
* SHARE */
#define ExclusiveLock 7 /* blocks ROW SHARE/SELECT...FOR
* UPDATE */
#define AccessExclusiveLock 8 /* ALTER TABLE, DROP TABLE, VACUUM
* FULL, and unqualified LOCK TABLE */
#define ExclusiveLock 7 /* blocks ROW SHARE/SELECT...FOR UPDATE */
#define AccessExclusiveLock 8 /* ALTER TABLE, DROP TABLE, VACUUM FULL,
* and unqualified LOCK TABLE */
typedef struct xl_standby_lock
{

View File

@ -99,9 +99,9 @@ typedef struct SERIALIZABLEXACT
TransactionId topXid; /* top level xid for the transaction, if one
* exists; else invalid */
TransactionId finishedBefore; /* invalid means still running; else
* the struct expires when no
* serializable xids are before this. */
TransactionId finishedBefore; /* invalid means still running; else the
* struct expires when no serializable
* xids are before this. */
TransactionId xmin; /* the transaction's snapshot xmin */
uint32 flags; /* OR'd combination of values defined below */
int pid; /* pid of associated process */
@ -160,14 +160,13 @@ typedef struct PredXactListData
int WritableSxactCount; /* how many non-read-only serializable
* transactions are active */
SerCommitSeqNo LastSxactCommitSeqNo; /* a strictly monotonically
* increasing number for
* commits of serializable
* transactions */
* increasing number for commits
* of serializable transactions */
/* Protected by SerializableXactHashLock. */
SerCommitSeqNo CanPartialClearThrough; /* can clear predicate locks
* and inConflicts for
* committed transactions
* through this seq no */
SerCommitSeqNo CanPartialClearThrough; /* can clear predicate locks and
* inConflicts for committed
* transactions through this seq
* no */
/* Protected by SerializableFinishedListLock. */
SerCommitSeqNo HavePartialClearedThrough; /* have cleared through this
* seq no */

View File

@ -27,16 +27,15 @@
* to avoid forcing to include proc.h when including procarray.h. So if you modify
* PROC_XXX flags, you need to modify these flags.
*/
#define PROCARRAY_VACUUM_FLAG 0x02 /* currently running
* lazy vacuum */
#define PROCARRAY_VACUUM_FLAG 0x02 /* currently running lazy
* vacuum */
#define PROCARRAY_ANALYZE_FLAG 0x04 /* currently running
* analyze */
#define PROCARRAY_LOGICAL_DECODING_FLAG 0x10 /* currently doing
* logical decoding
* outside xact */
#define PROCARRAY_LOGICAL_DECODING_FLAG 0x10 /* currently doing logical
* decoding outside xact */
#define PROCARRAY_SLOTS_XMIN 0x20 /* replication slot
* xmin, catalog_xmin */
#define PROCARRAY_SLOTS_XMIN 0x20 /* replication slot xmin,
* catalog_xmin */
/*
* Only flags in PROCARRAY_PROC_FLAGS_MASK are considered when matching
* PGXACT->vacuumFlags. Other flags are used for different purposes and

View File

@ -32,8 +32,7 @@ typedef enum
PROCSIG_CATCHUP_INTERRUPT, /* sinval catchup interrupt */
PROCSIG_NOTIFY_INTERRUPT, /* listen/notify interrupt */
PROCSIG_PARALLEL_MESSAGE, /* message from cooperating parallel backend */
PROCSIG_WALSND_INIT_STOPPING, /* ask walsenders to prepare for
* shutdown */
PROCSIG_WALSND_INIT_STOPPING, /* ask walsenders to prepare for shutdown */
/* Recovery conflict reasons */
PROCSIG_RECOVERY_CONFLICT_DATABASE,

View File

@ -42,9 +42,8 @@ typedef struct TSQueryParserStateData *TSQueryParserState;
typedef void (*PushFunction) (Datum opaque, TSQueryParserState state,
char *token, int tokenlen,
int16 tokenweights, /* bitmap as described
* in QueryOperand
* struct */
int16 tokenweights, /* bitmap as described in
* QueryOperand struct */
bool prefix);
extern TSQuery parse_tsquery(char *buf,

View File

@ -48,8 +48,8 @@ typedef struct catcache
int cc_nkeys; /* # of keys (1..CATCACHE_MAXKEYS) */
int cc_key[CATCACHE_MAXKEYS]; /* AttrNumber of each key */
PGFunction cc_hashfunc[CATCACHE_MAXKEYS]; /* hash function for each key */
ScanKeyData cc_skey[CATCACHE_MAXKEYS]; /* precomputed key info for
* heap scans */
ScanKeyData cc_skey[CATCACHE_MAXKEYS]; /* precomputed key info for heap
* scans */
bool cc_isname[CATCACHE_MAXKEYS]; /* flag "name" key columns */
dlist_head cc_lists; /* list of CatCList structs */
dlist_head *cc_bucket; /* hash buckets */

View File

@ -27,9 +27,9 @@
* server log by default. */
#define LOG_SERVER_ONLY 16 /* Same as LOG for server reporting, but never
* sent to client. */
#define COMMERROR LOG_SERVER_ONLY /* Client communication problems; same
* as LOG for server reporting, but
* never sent to client. */
#define COMMERROR LOG_SERVER_ONLY /* Client communication problems; same as
* LOG for server reporting, but never
* sent to client. */
#define INFO 17 /* Messages specifically requested by user (eg
* VACUUM VERBOSE output); always sent to
* client regardless of client_min_messages,

View File

@ -95,8 +95,8 @@ typedef struct CachedPlanSource
List *query_list; /* list of Query nodes, or NIL if not valid */
List *relationOids; /* OIDs of relations the queries depend on */
List *invalItems; /* other dependencies, as PlanInvalItems */
struct OverrideSearchPath *search_path; /* search_path used for
* parsing and planning */
struct OverrideSearchPath *search_path; /* search_path used for parsing
* and planning */
MemoryContext query_context; /* context holding the above, or NULL */
Oid rewriteRoleId; /* Role ID we did rewriting for */
bool rewriteRowSecurity; /* row_security used during rewrite */

View File

@ -278,8 +278,7 @@ typedef struct StdRdOptions
int32 vl_len_; /* varlena header (do not touch directly!) */
int fillfactor; /* page fill factor in percent (0..100) */
AutoVacOpts autovacuum; /* autovacuum-related options */
bool user_catalog_table; /* use as an additional catalog
* relation */
bool user_catalog_table; /* use as an additional catalog relation */
int parallel_workers; /* max number of parallel workers */
} StdRdOptions;

View File

@ -14,8 +14,7 @@
#define PGTYPES_TYPE_DOUBLE_NF 4 /* no fractional part */
#define PGTYPES_TYPE_INT64 5
#define PGTYPES_TYPE_UINT 6
#define PGTYPES_TYPE_UINT_2_LZ 7 /* 2 digits, pad with leading
* zero */
#define PGTYPES_TYPE_UINT_2_LZ 7 /* 2 digits, pad with leading zero */
#define PGTYPES_TYPE_UINT_2_LS 8 /* 2 digits, pad with leading
* space */
#define PGTYPES_TYPE_UINT_3_LZ 9

View File

@ -25,10 +25,9 @@ struct ECPGtype
* string */
union
{
struct ECPGtype *element; /* For an array this is the type of
* the element */
struct ECPGstruct_member *members; /* A pointer to a list of
* members. */
struct ECPGtype *element; /* For an array this is the type of the
* element */
struct ECPGstruct_member *members; /* A pointer to a list of members. */
} u;
int counter;
};

View File

@ -3510,8 +3510,7 @@ closePGconn(PGconn *conn)
* Close the connection, reset all transient state, flush I/O buffers.
*/
pqDropConnection(conn, true);
conn->status = CONNECTION_BAD; /* Well, not really _bad_ - just
* absent */
conn->status = CONNECTION_BAD; /* Well, not really _bad_ - just absent */
conn->asyncStatus = PGASYNC_IDLE;
pqClearAsyncResult(conn); /* deallocate result */
resetPQExpBuffer(&conn->errorMessage);

View File

@ -386,8 +386,7 @@ struct pg_conn
* sending semantics */
bool singleRowMode; /* return current query result row-by-row? */
char copy_is_binary; /* 1 = copy binary, 0 = copy text */
int copy_already_done; /* # bytes already returned in COPY
* OUT */
int copy_already_done; /* # bytes already returned in COPY OUT */
PGnotify *notifyHead; /* oldest unreported Notify msg */
PGnotify *notifyTail; /* newest unreported Notify msg */
@ -403,8 +402,7 @@ struct pg_conn
SockAddr raddr; /* Remote address */
ProtocolVersion pversion; /* FE/BE protocol version in use */
int sversion; /* server version, e.g. 70401 for 7.4.1 */
bool auth_req_received; /* true if any type of auth req
* received */
bool auth_req_received; /* true if any type of auth req received */
bool password_needed; /* true if server demanded a password */
bool pgpassfile_used; /* true if password is from pgpassfile */
bool sigpipe_so; /* have we masked SIGPIPE via SO_NOSIGPIPE? */

View File

@ -64,8 +64,7 @@ opendir(const char *dirname)
strcpy(d->dirname, dirname);
if (d->dirname[strlen(d->dirname) - 1] != '/' &&
d->dirname[strlen(d->dirname) - 1] != '\\')
strcat(d->dirname, "\\"); /* Append backslash if not already
* there */
strcat(d->dirname, "\\"); /* Append backslash if not already there */
strcat(d->dirname, "*"); /* Search for entries named anything */
d->handle = INVALID_HANDLE_VALUE;
d->ret.d_ino = 0; /* no inodes on win32 */
@ -102,8 +101,7 @@ readdir(DIR *d)
return NULL;
}
}
strcpy(d->ret.d_name, fd.cFileName); /* Both strings are MAX_PATH
* long */
strcpy(d->ret.d_name, fd.cFileName); /* Both strings are MAX_PATH long */
d->ret.d_namlen = strlen(d->ret.d_name);
return &d->ret;

View File

@ -1747,8 +1747,8 @@ run_schedule(const char *schedule, test_function tfunc)
bool newdiff;
if (tl)
tl = tl->next; /* tl has the same length as rl and el
* if it exists */
tl = tl->next; /* tl has the same length as rl and el if
* it exists */
newdiff = results_differ(tests[i], rl->str, el->str);
if (newdiff && tl)

View File

@ -708,8 +708,7 @@ Datum
int44out(PG_FUNCTION_ARGS)
{
int32 *an_array = (int32 *) PG_GETARG_POINTER(0);
char *result = (char *) palloc(16 * 4); /* Allow 14 digits +
* sign */
char *result = (char *) palloc(16 * 4); /* Allow 14 digits + sign */
int i;
char *walk;

View File

@ -235,11 +235,6 @@ sub post_indent
# Fix run-together comments to have a tab between them
$source =~ s!\*/(/\*.*\*/)$!*/\t$1!gm;
# cpp conditionals
# Reduce whitespace between #endif and comments to one tab
$source =~ s!^\#endif[ \t]+/\*!#endif /*!gm;
## Functions
# Use a single space before '*' in function return types