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!) */ int32 vl_len_; /* varlena header (do not touch directly!) */
int bloomLength; /* length of signature in words (not bits!) */ int bloomLength; /* length of signature in words (not bits!) */
int bitSize[INDEX_MAX_KEYS]; /* # of bits generated for int bitSize[INDEX_MAX_KEYS]; /* # of bits generated for each
* each index key */ * index key */
} BloomOptions; } 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 */ last = (*(aux2 + 1) == '!' || *(aux2 + 1) == '\0'); /* is the last character */
digit = (isdigit((unsigned char) *aux2) != 0); /* is current character digit = (isdigit((unsigned char) *aux2) != 0); /* is current character
* a digit? */ * a digit? */
if (*aux2 == '?' && last) /* automagically calculate check digit if (*aux2 == '?' && last) /* automagically calculate check digit if
* if it's '?' */ * it's '?' */
magic = digit = true; magic = digit = true;
if (length == 0 && (*aux2 == 'M' || *aux2 == 'm')) if (length == 0 && (*aux2 == 'M' || *aux2 == 'm'))
{ {
@ -832,8 +832,8 @@ string2ean(const char *str, bool errorOK, ean13 *result,
goto eanwrongtype; goto eanwrongtype;
break; break;
case ISMN: case ISMN:
memcpy(buf, "9790", 4); /* this isn't for sure yet, for now memcpy(buf, "9790", 4); /* this isn't for sure yet, for now ISMN
* ISMN it's only 9790 */ * it's only 9790 */
valid = (valid && ((rcheck = checkdig(buf, 13)) == check || magic)); valid = (valid && ((rcheck = checkdig(buf, 13)) == check || magic));
break; break;
case ISBN: 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 *priorWALFileName; /* the file we need to get from archive */
char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */ char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */
char restoreCommand[MAXPGPATH]; /* run this to restore */ char restoreCommand[MAXPGPATH]; /* run this to restore */
char exclusiveCleanupFileName[MAXFNAMELEN]; /* the file we need to char exclusiveCleanupFileName[MAXFNAMELEN]; /* the file we need to get
* get from archive */ * from archive */
/* /*
* Two types of failover are supported (smart and fast failover). * 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 char *client_label_peer = NULL; /* set by getpeercon(3) */
static List *client_label_pending = NIL; /* pending list being set by static List *client_label_pending = NIL; /* pending list being set by
* sepgsql_setcon() */ * sepgsql_setcon() */
static char *client_label_committed = NULL; /* set by sepgsql_setcon(), static char *client_label_committed = NULL; /* set by sepgsql_setcon(), and
* and already committed */ * already committed */
static char *client_label_func = NULL; /* set by trusted procedure */ static char *client_label_func = NULL; /* set by trusted procedure */
typedef struct typedef struct

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -62,8 +62,8 @@ typedef struct
static registered_buffer *registered_buffers; static registered_buffer *registered_buffers;
static int max_registered_buffers; /* allocated size */ static int max_registered_buffers; /* allocated size */
static int max_registered_block_id = 0; /* highest block_id + 1 static int max_registered_block_id = 0; /* highest block_id + 1 currently
* currently registered */ * registered */
/* /*
* A chain of XLogRecDatas to hold the "main data" of a WAL record, 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 class_oid; /* oid of catalog */
Oid oid_index_oid; /* oid of index on system oid column */ Oid oid_index_oid; /* oid of index on system oid column */
int oid_catcache_id; /* id of catcache 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), int name_catcache_id; /* id of catcache on (name,namespace), or
* or (name) if the object does not * (name) if the object does not live in a
* live in a namespace */ * namespace */
AttrNumber attnum_name; /* attnum of name field */ AttrNumber attnum_name; /* attnum of name field */
AttrNumber attnum_namespace; /* attnum of namespace field */ AttrNumber attnum_namespace; /* attnum of namespace field */
AttrNumber attnum_owner; /* attnum of owner field */ AttrNumber attnum_owner; /* attnum of owner field */
AttrNumber attnum_acl; /* attnum of acl field */ AttrNumber attnum_acl; /* attnum of acl field */
AclObjectKind acl_kind; /* ACL_KIND_* of this object type */ AclObjectKind acl_kind; /* ACL_KIND_* of this object type */
bool is_nsp_name_unique; /* can the nsp/name combination (or bool is_nsp_name_unique; /* can the nsp/name combination (or name
* name alone, if there's no * alone, if there's no namespace) be
* namespace) be considered a unique * considered a unique identifier for an
* identifier for an object of this * object of this class? */
* class? */
} ObjectPropertyType; } ObjectPropertyType;
static const ObjectPropertyType ObjectProperty[] = static const ObjectPropertyType ObjectProperty[] =

View File

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

View File

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

View File

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

View File

@ -3255,8 +3255,7 @@ typedef SetConstraintStateData *SetConstraintState;
*/ */
typedef uint32 TriggerFlags; typedef uint32 TriggerFlags;
#define AFTER_TRIGGER_OFFSET 0x0FFFFFFF /* must be low-order #define AFTER_TRIGGER_OFFSET 0x0FFFFFFF /* must be low-order bits */
* bits */
#define AFTER_TRIGGER_DONE 0x10000000 #define AFTER_TRIGGER_DONE 0x10000000
#define AFTER_TRIGGER_IN_PROGRESS 0x20000000 #define AFTER_TRIGGER_IN_PROGRESS 0x20000000
/* bits describing the size and tuple sources of this event */ /* 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 createdb = false; /* Can the user create databases? */
bool canlogin = false; /* Can this user login? */ bool canlogin = false; /* Can this user login? */
bool isreplication = false; /* Is this a replication role? */ bool isreplication = false; /* Is this a replication role? */
bool bypassrls = false; /* Is this a row security enabled bool bypassrls = false; /* Is this a row security enabled role? */
* role? */
int connlimit = -1; /* maximum connections allowed */ int connlimit = -1; /* maximum connections allowed */
List *addroleto = NIL; /* roles to make this a member of */ List *addroleto = NIL; /* roles to make this a member of */
List *rolemembers = NIL; /* roles to be members of this role */ List *rolemembers = NIL; /* roles to be members of this role */

View File

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

View File

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

View File

@ -446,8 +446,7 @@ _readRangeVar(void)
{ {
READ_LOCALS(RangeVar); READ_LOCALS(RangeVar);
local_node->catalogname = NULL; /* not currently saved in output local_node->catalogname = NULL; /* not currently saved in output format */
* format */
READ_STRING_FIELD(schemaname); READ_STRING_FIELD(schemaname);
READ_STRING_FIELD(relname); 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_aware = false;
pathnode->path.parallel_safe = rel->consider_parallel; pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = parallel_workers; pathnode->path.parallel_workers = parallel_workers;
pathnode->path.pathkeys = NIL; /* result is always considered pathnode->path.pathkeys = NIL; /* result is always considered unsorted */
* unsorted */
pathnode->partitioned_rels = list_copy(partitioned_rels); pathnode->partitioned_rels = list_copy(partitioned_rels);
pathnode->subpaths = subpaths; pathnode->subpaths = subpaths;

View File

@ -205,8 +205,7 @@ CheckpointerMain(void)
* want to wait for the backends to exit, whereupon the postmaster will * want to wait for the backends to exit, whereupon the postmaster will
* tell us it's okay to shut down (via SIGUSR2). * tell us it's okay to shut down (via SIGUSR2).
*/ */
pqsignal(SIGHUP, ChkptSigHupHandler); /* set flag to read config pqsignal(SIGHUP, ChkptSigHupHandler); /* set flag to read config file */
* file */
pqsignal(SIGINT, ReqCheckpointHandler); /* request checkpoint */ pqsignal(SIGINT, ReqCheckpointHandler); /* request checkpoint */
pqsignal(SIGTERM, SIG_IGN); /* ignore SIGTERM */ pqsignal(SIGTERM, SIG_IGN); /* ignore SIGTERM */
pqsignal(SIGQUIT, chkpt_quickdie); /* hard crash time */ 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 #define PGARCH_AUTOWAKE_INTERVAL 60 /* How often to force a poll of the
* archive status directory; in * archive status directory; in seconds. */
* seconds. */
#define PGARCH_RESTART_INTERVAL 10 /* How often to attempt to restart a #define PGARCH_RESTART_INTERVAL 10 /* How often to attempt to restart a
* failed archiver; in seconds. */ * failed archiver; in seconds. */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -85,8 +85,7 @@ typedef struct OldSnapshotControlData
*/ */
slock_t mutex_current; /* protect current_timestamp */ slock_t mutex_current; /* protect current_timestamp */
TimestampTz current_timestamp; /* latest snapshot timestamp */ TimestampTz current_timestamp; /* latest snapshot timestamp */
slock_t mutex_latest_xmin; /* protect latest_xmin and slock_t mutex_latest_xmin; /* protect latest_xmin and next_map_update */
* next_map_update */
TransactionId latest_xmin; /* latest snapshot xmin */ TransactionId latest_xmin; /* latest snapshot xmin */
TimestampTz next_map_update; /* latest snapshot valid up to */ TimestampTz next_map_update; /* latest snapshot valid up to */
slock_t mutex_threshold; /* protect threshold fields */ 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 *archiveLocation; /* where to find the archive? */
char *restartWALFileName; /* the file from which we can restart restore */ char *restartWALFileName; /* the file from which we can restart restore */
char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */ char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */
char exclusiveCleanupFileName[MAXFNAMELEN]; /* the oldest file we char exclusiveCleanupFileName[MAXFNAMELEN]; /* the oldest file we want
* want to remain in * to remain in archive */
* archive */
/* ===================================================================== /* =====================================================================

View File

@ -33,8 +33,7 @@ typedef struct StreamCtl
TimeLineID timeline; /* Timeline to stream data from */ TimeLineID timeline; /* Timeline to stream data from */
char *sysidentifier; /* Validate this system identifier and char *sysidentifier; /* Validate this system identifier and
* timeline */ * timeline */
int standby_message_timeout; /* Send status messages this int standby_message_timeout; /* Send status messages this often */
* often */
bool synchronous; /* Flush immediately WAL data on write */ bool synchronous; /* Flush immediately WAL data on write */
bool mark_done; /* Mark segment as done in generated archive */ bool mark_done; /* Mark segment as done in generated archive */
bool do_sync; /* Flush to disk to ensure consistent state of 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) if ((arg1 = strstr(optline, " \"")) != NULL)
{ {
*arg1 = '\0'; /* terminate so we get only program *arg1 = '\0'; /* terminate so we get only program name */
* name */
post_opts = pg_strdup(arg1 + 1); /* point past whitespace */ post_opts = pg_strdup(arg1 + 1); /* point past whitespace */
} }
if (exec_path == NULL) if (exec_path == NULL)

View File

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

View File

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

View File

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

View File

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

View File

@ -119,8 +119,7 @@ typedef ScanKeyData *ScanKey;
#define SK_ROW_END 0x0010 /* last row comparison member */ #define SK_ROW_END 0x0010 /* last row comparison member */
#define SK_SEARCHARRAY 0x0020 /* scankey represents ScalarArrayOp */ #define SK_SEARCHARRAY 0x0020 /* scankey represents ScalarArrayOp */
#define SK_SEARCHNULL 0x0040 /* scankey represents "col IS NULL" */ #define SK_SEARCHNULL 0x0040 /* scankey represents "col IS NULL" */
#define SK_SEARCHNOTNULL 0x0080 /* scankey represents "col IS NOT #define SK_SEARCHNOTNULL 0x0080 /* scankey represents "col IS NOT NULL" */
* NULL" */
#define SK_ORDER_BY 0x0100 /* scankey is for ORDER BY op */ #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? */ bool prefixHasPrefix; /* tuple should have a prefix? */
Datum prefixPrefixDatum; /* if so, its value */ Datum prefixPrefixDatum; /* if so, its value */
int prefixNNodes; /* number of nodes */ int prefixNNodes; /* number of nodes */
Datum *prefixNodeLabels; /* their labels (or NULL for Datum *prefixNodeLabels; /* their labels (or NULL for no
* no labels) */ * labels) */
int childNodeN; /* which node gets child tuple */ int childNodeN; /* which node gets child tuple */
/* Info to form new lower-level inner tuple with all old nodes */ /* 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 */ Datum reconstructedValue; /* value reconstructed at parent */
void *traversalValue; /* opclass-specific traverse value */ void *traversalValue; /* opclass-specific traverse value */
MemoryContext traversalMemoryContext; /* put new traverse values MemoryContext traversalMemoryContext; /* put new traverse values here */
* here */
int level; /* current level (counting from zero) */ int level; /* current level (counting from zero) */
bool returnData; /* original data must be returned? */ bool returnData; /* original data must be returned? */

View File

@ -25,8 +25,8 @@
/* Flags for bit map */ /* Flags for bit map */
#define VISIBILITYMAP_ALL_VISIBLE 0x01 #define VISIBILITYMAP_ALL_VISIBLE 0x01
#define VISIBILITYMAP_ALL_FROZEN 0x02 #define VISIBILITYMAP_ALL_FROZEN 0x02
#define VISIBILITYMAP_VALID_BITS 0x03 /* OR of all valid #define VISIBILITYMAP_VALID_BITS 0x03 /* OR of all valid visibilitymap
* visibilitymap flags bits */ * flags bits */
/* Macros for visibilitymap test */ /* Macros for visibilitymap test */
#define VM_ALL_VISIBLE(r, b, v) \ #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 SYNCHRONOUS_COMMIT_REMOTE_WRITE, /* wait for local flush and remote
* write */ * write */
SYNCHRONOUS_COMMIT_REMOTE_FLUSH, /* wait for local and remote flush */ SYNCHRONOUS_COMMIT_REMOTE_FLUSH, /* wait for local and remote flush */
SYNCHRONOUS_COMMIT_REMOTE_APPLY /* wait for local flush and remote SYNCHRONOUS_COMMIT_REMOTE_APPLY /* wait for local flush and remote apply */
* apply */
} SyncCommitLevel; } SyncCommitLevel;
/* Define the default setting for synchronous_commit */ /* 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 */ /* These directly affect the behavior of CreateCheckPoint and subsidiaries */
#define CHECKPOINT_IS_SHUTDOWN 0x0001 /* Checkpoint is for shutdown */ #define CHECKPOINT_IS_SHUTDOWN 0x0001 /* Checkpoint is for shutdown */
#define CHECKPOINT_END_OF_RECOVERY 0x0002 /* Like shutdown checkpoint, #define CHECKPOINT_END_OF_RECOVERY 0x0002 /* Like shutdown checkpoint, but
* but issued at end of WAL * issued at end of WAL recovery */
* recovery */
#define CHECKPOINT_IMMEDIATE 0x0004 /* Do it without delays */ #define CHECKPOINT_IMMEDIATE 0x0004 /* Do it without delays */
#define CHECKPOINT_FORCE 0x0008 /* Force even if no activity */ #define CHECKPOINT_FORCE 0x0008 /* Force even if no activity */
#define CHECKPOINT_FLUSH_ALL 0x0010 /* Flush all pages, including those #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_longest_sync; /* Longest sync for one relation */
uint64 ckpt_agg_sync_time; /* The sum of all the individual sync uint64 ckpt_agg_sync_time; /* The sum of all the individual sync
* times, which is not necessarily the * times, which is not necessarily the
* same as the total elapsed time for * same as the total elapsed time for the
* the entire sync phase. */ * entire sync phase. */
} CheckpointStatsData; } CheckpointStatsData;
extern CheckpointStatsData CheckpointStats; extern CheckpointStatsData CheckpointStats;

View File

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

View File

@ -49,8 +49,7 @@ CATALOG(pg_init_privs,3394) BKI_WITHOUT_OIDS
char privtype; /* from initdb or extension? */ char privtype; /* from initdb or extension? */
#ifdef CATALOG_VARLEN /* variable-length fields start here */ #ifdef CATALOG_VARLEN /* variable-length fields start here */
aclitem initprivs[1] BKI_FORCE_NOT_NULL; /* initial privs on aclitem initprivs[1] BKI_FORCE_NOT_NULL; /* initial privs on object */
* object */
#endif #endif
} FormData_pg_init_privs; } 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 */ #ifdef CATALOG_VARLEN /* variable-length fields start here */
text provider BKI_FORCE_NOT_NULL; /* name of label provider */ text provider BKI_FORCE_NOT_NULL; /* name of label provider */
text label BKI_FORCE_NOT_NULL; /* security label of the text label BKI_FORCE_NOT_NULL; /* security label of the object */
* object */
#endif #endif
} FormData_pg_seclabel; } 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 */ #ifdef CATALOG_VARLEN /* variable-length fields start here */
text provider BKI_FORCE_NOT_NULL; /* name of label provider */ text provider BKI_FORCE_NOT_NULL; /* name of label provider */
text label BKI_FORCE_NOT_NULL; /* security label of the text label BKI_FORCE_NOT_NULL; /* security label of the object */
* object */
#endif #endif
} FormData_pg_shseclabel; } 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_INIT 'i' /* initializing (sublsn NULL) */
#define SUBREL_STATE_DATASYNC 'd' /* data is being synchronized (sublsn #define SUBREL_STATE_DATASYNC 'd' /* data is being synchronized (sublsn
* NULL) */ * NULL) */
#define SUBREL_STATE_SYNCDONE 's' /* synchronization finished in front #define SUBREL_STATE_SYNCDONE 's' /* synchronization finished in front of
* of apply (sublsn set) */ * apply (sublsn set) */
#define SUBREL_STATE_READY 'r' /* ready (sublsn set) */ #define SUBREL_STATE_READY 'r' /* ready (sublsn set) */
/* These are never stored in the catalog, we only use them for IPC. */ /* 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_min_age; /* min freeze age, -1 to use default */
int freeze_table_age; /* age at which to scan whole table */ int freeze_table_age; /* age at which to scan whole table */
int multixact_freeze_min_age; /* min multixact freeze age, int multixact_freeze_min_age; /* min multixact freeze age, -1 to
* -1 to use default */ * use default */
int multixact_freeze_table_age; /* multixact age at which to int multixact_freeze_table_age; /* multixact age at which to scan
* scan whole table */ * whole table */
bool is_wraparound; /* force a for-wraparound vacuum */ bool is_wraparound; /* force a for-wraparound vacuum */
int log_min_duration; /* minimum execution threshold in ms int log_min_duration; /* minimum execution threshold in ms at
* at which verbose logs are * which verbose logs are activated, -1
* activated, -1 to use default */ * to use default */
} VacuumParams; } VacuumParams;
/* GUC parameters */ /* GUC parameters */
extern PGDLLIMPORT int default_statistics_target; /* PGDLLIMPORT for extern PGDLLIMPORT int default_statistics_target; /* PGDLLIMPORT for PostGIS */
* PostGIS */
extern int vacuum_freeze_min_age; extern int vacuum_freeze_min_age;
extern int vacuum_freeze_table_age; extern int vacuum_freeze_table_age;
extern int vacuum_multixact_freeze_min_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 nbuckets; /* # buckets in the in-memory hash table */
int log2_nbuckets; /* its log2 (nbuckets must be a power of 2) */ int log2_nbuckets; /* its log2 (nbuckets must be a power of 2) */
int nbuckets_original; /* # buckets when starting the first int nbuckets_original; /* # buckets when starting the first hash */
* hash */
int nbuckets_optimal; /* optimal # buckets (per batch) */ int nbuckets_optimal; /* optimal # buckets (per batch) */
int log2_nbuckets_optimal; /* log2(nbuckets_optimal) */ 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 *nl_right; /* right mark for newline */
const char *wrap_left; /* left mark after wrapped data */ const char *wrap_left; /* left mark after wrapped data */
const char *wrap_right; /* right mark for wrapped data */ const char *wrap_right; /* right mark for wrapped data */
bool wrap_right_border; /* use right-hand border for wrap bool wrap_right_border; /* use right-hand border for wrap marks
* marks when border=0? */ * when border=0? */
} printTextFormat; } printTextFormat;
typedef enum unicode_linestyle typedef enum unicode_linestyle
@ -167,8 +167,8 @@ typedef struct printQueryOpt
char *title; /* override title */ char *title; /* override title */
char **footers; /* override footer (default is "(xx rows)") */ char **footers; /* override footer (default is "(xx rows)") */
bool translate_header; /* do gettext on column headers */ bool translate_header; /* do gettext on column headers */
const bool *translate_columns; /* translate_columns[i-1] => do const bool *translate_columns; /* translate_columns[i-1] => do gettext on
* gettext on col i */ * col i */
int n_translate_columns; /* length of translate_columns[] */ int n_translate_columns; /* length of translate_columns[] */
} printQueryOpt; } printQueryOpt;

View File

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

View File

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

View File

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

View File

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

View File

@ -692,8 +692,8 @@ typedef struct SubPlan
/* Extra data useful for determining subplan's output type: */ /* Extra data useful for determining subplan's output type: */
Oid firstColType; /* Type of first column of subplan result */ Oid firstColType; /* Type of first column of subplan result */
int32 firstColTypmod; /* Typmod of first column of subplan result */ int32 firstColTypmod; /* Typmod of first column of subplan result */
Oid firstColCollation; /* Collation of first column of Oid firstColCollation; /* Collation of first column of subplan
* subplan result */ * result */
/* Information about execution strategy: */ /* Information about execution strategy: */
bool useHashTable; /* TRUE to store subselect output in a hash bool useHashTable; /* TRUE to store subselect output in a hash
* table (implies we are doing "IN") */ * 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 *cte_plan_ids; /* per-CTE-item list of subplan IDs */
List *multiexpr_params; /* List of Lists of Params for List *multiexpr_params; /* List of Lists of Params for MULTIEXPR
* MULTIEXPR subquery outputs */ * subquery outputs */
List *eq_classes; /* list of active EquivalenceClasses */ List *eq_classes; /* list of active EquivalenceClasses */
List *canon_pathkeys; /* list of "canonical" PathKeys */ List *canon_pathkeys; /* list of "canonical" PathKeys */
List *left_join_clauses; /* list of RestrictInfos for List *left_join_clauses; /* list of RestrictInfos for mergejoinable
* mergejoinable outer join clauses * outer join clauses w/nonnullable var on
* w/nonnullable var on left */ * left */
List *right_join_clauses; /* list of RestrictInfos for List *right_join_clauses; /* list of RestrictInfos for mergejoinable
* mergejoinable outer join clauses * outer join clauses w/nonnullable var on
* w/nonnullable var on right */ * right */
List *full_join_clauses; /* list of RestrictInfos for List *full_join_clauses; /* list of RestrictInfos for mergejoinable
* mergejoinable full join clauses */ * full join clauses */
List *join_info_list; /* list of SpecialJoinInfos */ 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) */ List *non_unique_for_rels; /* known not unique for these set(s) */
/* used by various scans and joins: */ /* used by various scans and joins: */
List *baserestrictinfo; /* RestrictInfo structures (if base List *baserestrictinfo; /* RestrictInfo structures (if base rel) */
* rel) */
QualCost baserestrictcost; /* cost of evaluating the above */ QualCost baserestrictcost; /* cost of evaluating the above */
Index baserestrict_min_security; /* min security_level found in Index baserestrict_min_security; /* min security_level found in
* baserestrictinfo */ * baserestrictinfo */
@ -959,8 +958,7 @@ typedef struct Path
bool parallel_aware; /* engage parallel-aware logic? */ bool parallel_aware; /* engage parallel-aware logic? */
bool parallel_safe; /* OK to use as part of parallel plan? */ bool parallel_safe; /* OK to use as part of parallel plan? */
int parallel_workers; /* desired # of workers; 0 = not int parallel_workers; /* desired # of workers; 0 = not parallel */
* parallel */
/* estimated size/costs for path (see costsize.c for more info) */ /* estimated size/costs for path (see costsize.c for more info) */
double rows; /* estimated number of result tuples */ 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 */ List *p_locking_clause; /* raw FOR UPDATE/FOR SHARE info */
bool p_locked_from_parent; /* parent has marked this subquery bool p_locked_from_parent; /* parent has marked this subquery
* with FOR UPDATE/FOR SHARE */ * with FOR UPDATE/FOR SHARE */
bool p_resolve_unknowns; /* resolve unknown-type SELECT outputs bool p_resolve_unknowns; /* resolve unknown-type SELECT outputs as
* as type text */ * type text */
QueryEnvironment *p_queryEnv; /* curr env, incl refs to enclosing QueryEnvironment *p_queryEnv; /* curr env, incl refs to enclosing env */
* env */
/* Flags telling about things found in the query: */ /* Flags telling about things found in the query: */
bool p_hasAggs; bool p_hasAggs;

View File

@ -64,8 +64,8 @@
#define BM_JUST_DIRTIED (1U << 28) /* dirtied since write started */ #define BM_JUST_DIRTIED (1U << 28) /* dirtied since write started */
#define BM_PIN_COUNT_WAITER (1U << 29) /* have waiter for sole pin */ #define BM_PIN_COUNT_WAITER (1U << 29) /* have waiter for sole pin */
#define BM_CHECKPOINT_NEEDED (1U << 30) /* must write for checkpoint */ #define BM_CHECKPOINT_NEEDED (1U << 30) /* must write for checkpoint */
#define BM_PERMANENT (1U << 31) /* permanent buffer (not #define BM_PERMANENT (1U << 31) /* permanent buffer (not unlogged,
* unlogged, or init fork) */ * or init fork) */
/* /*
* The maximum allowed value of usage_count represents a tradeoff between * The maximum allowed value of usage_count represents a tradeoff between
* accuracy and speed of the clock-sweep buffer management algorithm. A * 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. * Again, this is just a hint.
*/ */
#define PD_HAS_FREE_LINES 0x0001 /* are there any unused line pointers? */ #define PD_HAS_FREE_LINES 0x0001 /* are there any unused line pointers? */
#define PD_PAGE_FULL 0x0002 /* not enough free space for new #define PD_PAGE_FULL 0x0002 /* not enough free space for new tuple? */
* tuple? */
#define PD_ALL_VISIBLE 0x0004 /* all tuples on page are visible to #define PD_ALL_VISIBLE 0x0004 /* all tuples on page are visible to
* everyone */ * everyone */

View File

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

View File

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

View File

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

View File

@ -27,16 +27,15 @@
* to avoid forcing to include proc.h when including procarray.h. So if you modify * to avoid forcing to include proc.h when including procarray.h. So if you modify
* PROC_XXX flags, you need to modify these flags. * PROC_XXX flags, you need to modify these flags.
*/ */
#define PROCARRAY_VACUUM_FLAG 0x02 /* currently running #define PROCARRAY_VACUUM_FLAG 0x02 /* currently running lazy
* lazy vacuum */ * vacuum */
#define PROCARRAY_ANALYZE_FLAG 0x04 /* currently running #define PROCARRAY_ANALYZE_FLAG 0x04 /* currently running
* analyze */ * analyze */
#define PROCARRAY_LOGICAL_DECODING_FLAG 0x10 /* currently doing #define PROCARRAY_LOGICAL_DECODING_FLAG 0x10 /* currently doing logical
* logical decoding * decoding outside xact */
* outside xact */
#define PROCARRAY_SLOTS_XMIN 0x20 /* replication slot #define PROCARRAY_SLOTS_XMIN 0x20 /* replication slot xmin,
* xmin, catalog_xmin */ * catalog_xmin */
/* /*
* Only flags in PROCARRAY_PROC_FLAGS_MASK are considered when matching * Only flags in PROCARRAY_PROC_FLAGS_MASK are considered when matching
* PGXACT->vacuumFlags. Other flags are used for different purposes and * 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_CATCHUP_INTERRUPT, /* sinval catchup interrupt */
PROCSIG_NOTIFY_INTERRUPT, /* listen/notify interrupt */ PROCSIG_NOTIFY_INTERRUPT, /* listen/notify interrupt */
PROCSIG_PARALLEL_MESSAGE, /* message from cooperating parallel backend */ PROCSIG_PARALLEL_MESSAGE, /* message from cooperating parallel backend */
PROCSIG_WALSND_INIT_STOPPING, /* ask walsenders to prepare for PROCSIG_WALSND_INIT_STOPPING, /* ask walsenders to prepare for shutdown */
* shutdown */
/* Recovery conflict reasons */ /* Recovery conflict reasons */
PROCSIG_RECOVERY_CONFLICT_DATABASE, PROCSIG_RECOVERY_CONFLICT_DATABASE,

View File

@ -42,9 +42,8 @@ typedef struct TSQueryParserStateData *TSQueryParserState;
typedef void (*PushFunction) (Datum opaque, TSQueryParserState state, typedef void (*PushFunction) (Datum opaque, TSQueryParserState state,
char *token, int tokenlen, char *token, int tokenlen,
int16 tokenweights, /* bitmap as described int16 tokenweights, /* bitmap as described in
* in QueryOperand * QueryOperand struct */
* struct */
bool prefix); bool prefix);
extern TSQuery parse_tsquery(char *buf, 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_nkeys; /* # of keys (1..CATCACHE_MAXKEYS) */
int cc_key[CATCACHE_MAXKEYS]; /* AttrNumber of each key */ int cc_key[CATCACHE_MAXKEYS]; /* AttrNumber of each key */
PGFunction cc_hashfunc[CATCACHE_MAXKEYS]; /* hash function for each key */ PGFunction cc_hashfunc[CATCACHE_MAXKEYS]; /* hash function for each key */
ScanKeyData cc_skey[CATCACHE_MAXKEYS]; /* precomputed key info for ScanKeyData cc_skey[CATCACHE_MAXKEYS]; /* precomputed key info for heap
* heap scans */ * scans */
bool cc_isname[CATCACHE_MAXKEYS]; /* flag "name" key columns */ bool cc_isname[CATCACHE_MAXKEYS]; /* flag "name" key columns */
dlist_head cc_lists; /* list of CatCList structs */ dlist_head cc_lists; /* list of CatCList structs */
dlist_head *cc_bucket; /* hash buckets */ dlist_head *cc_bucket; /* hash buckets */

View File

@ -27,9 +27,9 @@
* server log by default. */ * server log by default. */
#define LOG_SERVER_ONLY 16 /* Same as LOG for server reporting, but never #define LOG_SERVER_ONLY 16 /* Same as LOG for server reporting, but never
* sent to client. */ * sent to client. */
#define COMMERROR LOG_SERVER_ONLY /* Client communication problems; same #define COMMERROR LOG_SERVER_ONLY /* Client communication problems; same as
* as LOG for server reporting, but * LOG for server reporting, but never
* never sent to client. */ * sent to client. */
#define INFO 17 /* Messages specifically requested by user (eg #define INFO 17 /* Messages specifically requested by user (eg
* VACUUM VERBOSE output); always sent to * VACUUM VERBOSE output); always sent to
* client regardless of client_min_messages, * 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 *query_list; /* list of Query nodes, or NIL if not valid */
List *relationOids; /* OIDs of relations the queries depend on */ List *relationOids; /* OIDs of relations the queries depend on */
List *invalItems; /* other dependencies, as PlanInvalItems */ List *invalItems; /* other dependencies, as PlanInvalItems */
struct OverrideSearchPath *search_path; /* search_path used for struct OverrideSearchPath *search_path; /* search_path used for parsing
* parsing and planning */ * and planning */
MemoryContext query_context; /* context holding the above, or NULL */ MemoryContext query_context; /* context holding the above, or NULL */
Oid rewriteRoleId; /* Role ID we did rewriting for */ Oid rewriteRoleId; /* Role ID we did rewriting for */
bool rewriteRowSecurity; /* row_security used during rewrite */ 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!) */ int32 vl_len_; /* varlena header (do not touch directly!) */
int fillfactor; /* page fill factor in percent (0..100) */ int fillfactor; /* page fill factor in percent (0..100) */
AutoVacOpts autovacuum; /* autovacuum-related options */ AutoVacOpts autovacuum; /* autovacuum-related options */
bool user_catalog_table; /* use as an additional catalog bool user_catalog_table; /* use as an additional catalog relation */
* relation */
int parallel_workers; /* max number of parallel workers */ int parallel_workers; /* max number of parallel workers */
} StdRdOptions; } StdRdOptions;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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