Update typedefs.list and re-run pgindent

Discussion: http://postgr.es/m/CA+TgmoaA9=1RWKtBWpDaj+sF3Stgc8sHgf5z=KGtbjwPLQVDMA@mail.gmail.com
This commit is contained in:
Robert Haas 2017-11-29 09:24:24 -05:00
parent 801386af62
commit eaedf0df71
52 changed files with 224 additions and 197 deletions

View File

@ -104,7 +104,7 @@ soundex_code(char letter)
#define TH '0' #define TH '0'
static char Lookahead(char *word, int how_far); static char Lookahead(char *word, int how_far);
static void _metaphone(char *word, int max_phonemes, char **phoned_word); static void _metaphone(char *word, int max_phonemes, char **phoned_word);
/* Metachar.h ... little bits about characters for metaphone */ /* Metachar.h ... little bits about characters for metaphone */

View File

@ -925,7 +925,7 @@ eantoobig:
* Exported routines. * Exported routines.
*---------------------------------------------------------*/ *---------------------------------------------------------*/
void _PG_init(void); void _PG_init(void);
void void
_PG_init(void) _PG_init(void)

View File

@ -1314,8 +1314,8 @@ brinsummarize(Relation index, Relation heapRel, BlockNumber pageRange,
/* /*
* Unless requested to summarize even a partial range, go away now if * Unless requested to summarize even a partial range, go away now if
* we think the next range is partial. Caller would pass true when * we think the next range is partial. Caller would pass true when it
* it is typically run once bulk data loading is done * is typically run once bulk data loading is done
* (brin_summarize_new_values), and false when it is typically the * (brin_summarize_new_values), and false when it is typically the
* result of arbitrarily-scheduled maintenance command (vacuuming). * result of arbitrarily-scheduled maintenance command (vacuuming).
*/ */

View File

@ -41,12 +41,12 @@ printsimple_startup(DestReceiver *self, int operation, TupleDesc tupdesc)
Form_pg_attribute attr = TupleDescAttr(tupdesc, i); Form_pg_attribute attr = TupleDescAttr(tupdesc, i);
pq_sendstring(&buf, NameStr(attr->attname)); pq_sendstring(&buf, NameStr(attr->attname));
pq_sendint32(&buf, 0); /* table oid */ pq_sendint32(&buf, 0); /* table oid */
pq_sendint16(&buf, 0); /* attnum */ pq_sendint16(&buf, 0); /* attnum */
pq_sendint32(&buf, (int) attr->atttypid); pq_sendint32(&buf, (int) attr->atttypid);
pq_sendint16(&buf, attr->attlen); pq_sendint16(&buf, attr->attlen);
pq_sendint32(&buf, attr->atttypmod); pq_sendint32(&buf, attr->atttypmod);
pq_sendint16(&buf, 0); /* format code */ pq_sendint16(&buf, 0); /* format code */
} }
pq_endmessage(&buf); pq_endmessage(&buf);

View File

@ -6586,10 +6586,10 @@ StartupXLOG(void)
else else
{ {
/* /*
* We used to attempt to go back to a secondary checkpoint * We used to attempt to go back to a secondary checkpoint record
* record here, but only when not in standby_mode. We now * here, but only when not in standby_mode. We now just fail if we
* just fail if we can't read the last checkpoint because * can't read the last checkpoint because this allows us to
* this allows us to simplify processing around checkpoints. * simplify processing around checkpoints.
*/ */
ereport(PANIC, ereport(PANIC,
(errmsg("could not locate a valid checkpoint record"))); (errmsg("could not locate a valid checkpoint record")));
@ -8888,7 +8888,8 @@ CreateCheckPoint(int flags)
(errmsg("concurrent write-ahead log activity while database system is shutting down"))); (errmsg("concurrent write-ahead log activity while database system is shutting down")));
/* /*
* Remember the prior checkpoint's redo ptr for UpdateCheckPointDistanceEstimate() * Remember the prior checkpoint's redo ptr for
* UpdateCheckPointDistanceEstimate()
*/ */
PriorRedoPtr = ControlFile->checkPointCopy.redo; PriorRedoPtr = ControlFile->checkPointCopy.redo;
@ -9211,7 +9212,8 @@ CreateRestartPoint(int flags)
CheckPointGuts(lastCheckPoint.redo, flags); CheckPointGuts(lastCheckPoint.redo, flags);
/* /*
* Remember the prior checkpoint's redo ptr for UpdateCheckPointDistanceEstimate() * Remember the prior checkpoint's redo ptr for
* UpdateCheckPointDistanceEstimate()
*/ */
PriorRedoPtr = ControlFile->checkPointCopy.redo; PriorRedoPtr = ControlFile->checkPointCopy.redo;

View File

@ -802,7 +802,7 @@ void
XLogReadDetermineTimeline(XLogReaderState *state, XLogRecPtr wantPage, uint32 wantLength) XLogReadDetermineTimeline(XLogReaderState *state, XLogRecPtr wantPage, uint32 wantLength)
{ {
const XLogRecPtr lastReadPage = state->readSegNo * const XLogRecPtr lastReadPage = state->readSegNo *
state->wal_segment_size + state->readOff; state->wal_segment_size + state->readOff;
Assert(wantPage != InvalidXLogRecPtr && wantPage % XLOG_BLCKSZ == 0); Assert(wantPage != InvalidXLogRecPtr && wantPage % XLOG_BLCKSZ == 0);
Assert(wantLength <= XLOG_BLCKSZ); Assert(wantLength <= XLOG_BLCKSZ);

View File

@ -2134,7 +2134,7 @@ get_qual_for_range(Relation parent, PartitionBoundSpec *spec,
if (or_expr_args != NIL) if (or_expr_args != NIL)
{ {
Expr *other_parts_constr; Expr *other_parts_constr;
/* /*
* Combine the constraints obtained for non-default partitions * Combine the constraints obtained for non-default partitions
@ -2143,20 +2143,20 @@ get_qual_for_range(Relation parent, PartitionBoundSpec *spec,
* useless repetition). Add the same now. * useless repetition). Add the same now.
*/ */
other_parts_constr = other_parts_constr =
makeBoolExpr(AND_EXPR, makeBoolExpr(AND_EXPR,
lappend(get_range_nulltest(key), lappend(get_range_nulltest(key),
list_length(or_expr_args) > 1 list_length(or_expr_args) > 1
? makeBoolExpr(OR_EXPR, or_expr_args, ? makeBoolExpr(OR_EXPR, or_expr_args,
-1) -1)
: linitial(or_expr_args)), : linitial(or_expr_args)),
-1); -1);
/* /*
* Finally, the default partition contains everything *NOT* * Finally, the default partition contains everything *NOT*
* contained in the non-default partitions. * contained in the non-default partitions.
*/ */
result = list_make1(makeBoolExpr(NOT_EXPR, result = list_make1(makeBoolExpr(NOT_EXPR,
list_make1(other_parts_constr), -1)); list_make1(other_parts_constr), -1));
} }
return result; return result;
@ -2502,9 +2502,9 @@ generate_partition_qual(Relation rel)
int int
get_partition_for_tuple(Relation relation, Datum *values, bool *isnull) get_partition_for_tuple(Relation relation, Datum *values, bool *isnull)
{ {
int bound_offset; int bound_offset;
int part_index = -1; int part_index = -1;
PartitionKey key = RelationGetPartitionKey(relation); PartitionKey key = RelationGetPartitionKey(relation);
PartitionDesc partdesc = RelationGetPartitionDesc(relation); PartitionDesc partdesc = RelationGetPartitionDesc(relation);
/* Route as appropriate based on partitioning strategy. */ /* Route as appropriate based on partitioning strategy. */
@ -2513,8 +2513,8 @@ get_partition_for_tuple(Relation relation, Datum *values, bool *isnull)
case PARTITION_STRATEGY_HASH: case PARTITION_STRATEGY_HASH:
{ {
PartitionBoundInfo boundinfo = partdesc->boundinfo; PartitionBoundInfo boundinfo = partdesc->boundinfo;
int greatest_modulus = get_greatest_modulus(boundinfo); int greatest_modulus = get_greatest_modulus(boundinfo);
uint64 rowHash = compute_hash_value(key, values, isnull); uint64 rowHash = compute_hash_value(key, values, isnull);
part_index = boundinfo->indexes[rowHash % greatest_modulus]; part_index = boundinfo->indexes[rowHash % greatest_modulus];
} }
@ -2548,8 +2548,7 @@ get_partition_for_tuple(Relation relation, Datum *values, bool *isnull)
/* /*
* No range includes NULL, so this will be accepted by the * No range includes NULL, so this will be accepted by the
* default partition if there is one, and otherwise * default partition if there is one, and otherwise rejected.
* rejected.
*/ */
for (i = 0; i < key->partnatts; i++) for (i = 0; i < key->partnatts; i++)
{ {
@ -2563,7 +2562,7 @@ get_partition_for_tuple(Relation relation, Datum *values, bool *isnull)
if (!range_partkey_has_null) if (!range_partkey_has_null)
{ {
bound_offset = partition_bound_bsearch(key, bound_offset = partition_bound_bsearch(key,
partdesc->boundinfo, partdesc->boundinfo,
values, values,
false, false,
&equal); &equal);
@ -2585,8 +2584,8 @@ get_partition_for_tuple(Relation relation, Datum *values, bool *isnull)
} }
/* /*
* part_index < 0 means we failed to find a partition of this parent. * part_index < 0 means we failed to find a partition of this parent. Use
* Use the default partition, if there is one. * the default partition, if there is one.
*/ */
if (part_index < 0) if (part_index < 0)
part_index = partdesc->boundinfo->default_index; part_index = partdesc->boundinfo->default_index;
@ -3125,7 +3124,7 @@ satisfies_hash_partition(PG_FUNCTION_ARGS)
bool variadic_typbyval; bool variadic_typbyval;
char variadic_typalign; char variadic_typalign;
FmgrInfo partsupfunc[PARTITION_MAX_KEYS]; FmgrInfo partsupfunc[PARTITION_MAX_KEYS];
} ColumnsHashData; } ColumnsHashData;
Oid parentId; Oid parentId;
int modulus; int modulus;
int remainder; int remainder;

View File

@ -168,7 +168,7 @@ typedef struct CopyStateData
PartitionDispatch *partition_dispatch_info; PartitionDispatch *partition_dispatch_info;
int num_dispatch; /* Number of entries in the above array */ int num_dispatch; /* Number of entries in the above array */
int num_partitions; /* Number of members in the following arrays */ int num_partitions; /* Number of members in the following arrays */
ResultRelInfo **partitions; /* Per partition result relation pointers */ ResultRelInfo **partitions; /* Per partition result relation pointers */
TupleConversionMap **partition_tupconv_maps; TupleConversionMap **partition_tupconv_maps;
TupleTableSlot *partition_tuple_slot; TupleTableSlot *partition_tuple_slot;
TransitionCaptureState *transition_capture; TransitionCaptureState *transition_capture;
@ -360,7 +360,7 @@ SendCopyBegin(CopyState cstate)
pq_sendbyte(&buf, format); /* overall format */ pq_sendbyte(&buf, format); /* overall format */
pq_sendint16(&buf, natts); pq_sendint16(&buf, natts);
for (i = 0; i < natts; i++) for (i = 0; i < natts; i++)
pq_sendint16(&buf, format); /* per-column formats */ pq_sendint16(&buf, format); /* per-column formats */
pq_endmessage(&buf); pq_endmessage(&buf);
cstate->copy_dest = COPY_NEW_FE; cstate->copy_dest = COPY_NEW_FE;
} }
@ -393,7 +393,7 @@ ReceiveCopyBegin(CopyState cstate)
pq_sendbyte(&buf, format); /* overall format */ pq_sendbyte(&buf, format); /* overall format */
pq_sendint16(&buf, natts); pq_sendint16(&buf, natts);
for (i = 0; i < natts; i++) for (i = 0; i < natts; i++)
pq_sendint16(&buf, format); /* per-column formats */ pq_sendint16(&buf, format); /* per-column formats */
pq_endmessage(&buf); pq_endmessage(&buf);
cstate->copy_dest = COPY_NEW_FE; cstate->copy_dest = COPY_NEW_FE;
cstate->fe_msgbuf = makeStringInfo(); cstate->fe_msgbuf = makeStringInfo();

View File

@ -355,7 +355,7 @@ lazy_vacuum_rel(Relation onerel, int options, VacuumParams *params,
params->log_min_duration)) params->log_min_duration))
{ {
StringInfoData buf; StringInfoData buf;
char *msgfmt; char *msgfmt;
TimestampDifference(starttime, endtime, &secs, &usecs); TimestampDifference(starttime, endtime, &secs, &usecs);

View File

@ -184,10 +184,10 @@ ExecFindPartition(ResultRelInfo *resultRelInfo, PartitionDispatch *pd,
parent = pd[0]; parent = pd[0];
while (true) while (true)
{ {
PartitionDesc partdesc; PartitionDesc partdesc;
TupleTableSlot *myslot = parent->tupslot; TupleTableSlot *myslot = parent->tupslot;
TupleConversionMap *map = parent->tupmap; TupleConversionMap *map = parent->tupmap;
int cur_index = -1; int cur_index = -1;
rel = parent->reldesc; rel = parent->reldesc;
partdesc = RelationGetPartitionDesc(rel); partdesc = RelationGetPartitionDesc(rel);

View File

@ -1518,8 +1518,8 @@ ExecSetupTransitionCaptureState(ModifyTableState *mtstate, EState *estate)
if (mtstate->mt_partition_dispatch_info != NULL) if (mtstate->mt_partition_dispatch_info != NULL)
{ {
/* /*
* For tuple routing among partitions, we need TupleDescs based * For tuple routing among partitions, we need TupleDescs based on
* on the partition routing table. * the partition routing table.
*/ */
ResultRelInfo **resultRelInfos = mtstate->mt_partitions; ResultRelInfo **resultRelInfos = mtstate->mt_partitions;

View File

@ -791,6 +791,7 @@ read_client_first_message(scram_state *state, char *input)
switch (*input) switch (*input)
{ {
case 'n': case 'n':
/* /*
* The client does not support channel binding or has simply * The client does not support channel binding or has simply
* decided to not use it. In that case just let it go. * decided to not use it. In that case just let it go.
@ -805,6 +806,7 @@ read_client_first_message(scram_state *state, char *input)
input++; input++;
break; break;
case 'y': case 'y':
/* /*
* The client supports channel binding and thinks that the server * The client supports channel binding and thinks that the server
* does not. In this case, the server must fail authentication if * does not. In this case, the server must fail authentication if
@ -827,12 +829,13 @@ read_client_first_message(scram_state *state, char *input)
input++; input++;
break; break;
case 'p': case 'p':
/* /*
* The client requires channel binding. Channel binding type * The client requires channel binding. Channel binding type
* follows, e.g., "p=tls-unique". * follows, e.g., "p=tls-unique".
*/ */
{ {
char *channel_binding_type; char *channel_binding_type;
if (!state->ssl_in_use) if (!state->ssl_in_use)
{ {
@ -1139,8 +1142,8 @@ read_client_final_message(scram_state *state, char *input)
b64_message[b64_message_len] = '\0'; b64_message[b64_message_len] = '\0';
/* /*
* Compare the value sent by the client with the value expected by * Compare the value sent by the client with the value expected by the
* the server. * server.
*/ */
if (strcmp(channel_binding, b64_message) != 0) if (strcmp(channel_binding, b64_message) != 0)
ereport(ERROR, ereport(ERROR,

View File

@ -100,7 +100,8 @@ static struct pam_conv pam_passw_conv = {
NULL NULL
}; };
static const char *pam_passwd = NULL; /* Workaround for Solaris 2.6 brokenness */ static const char *pam_passwd = NULL; /* Workaround for Solaris 2.6
* brokenness */
static Port *pam_port_cludge; /* Workaround for passing "Port *port" into static Port *pam_port_cludge; /* Workaround for passing "Port *port" into
* pam_passwd_conv_proc */ * pam_passwd_conv_proc */
#endif /* USE_PAM */ #endif /* USE_PAM */
@ -914,6 +915,7 @@ CheckSCRAMAuth(Port *port, char *shadow_pass, char **logdetail)
pfree(sasl_mechs); pfree(sasl_mechs);
#ifdef USE_SSL #ifdef USE_SSL
/* /*
* Get data for channel binding. * Get data for channel binding.
*/ */
@ -2343,7 +2345,7 @@ CheckBSDAuth(Port *port, char *user)
*/ */
#ifdef USE_LDAP #ifdef USE_LDAP
static int errdetail_for_ldap(LDAP *ldap); static int errdetail_for_ldap(LDAP *ldap);
/* /*
* Initialize a connection to the LDAP server, including setting up * Initialize a connection to the LDAP server, including setting up
@ -2514,7 +2516,7 @@ CheckLDAPAuth(Port *port)
char *filter; char *filter;
LDAPMessage *search_message; LDAPMessage *search_message;
LDAPMessage *entry; LDAPMessage *entry;
char *attributes[] = { LDAP_NO_ATTRS, NULL }; char *attributes[] = {LDAP_NO_ATTRS, NULL};
char *dn; char *dn;
char *c; char *c;
int count; int count;

View File

@ -1795,7 +1795,7 @@ set_upper_references(PlannerInfo *root, Plan *plan, int rtoffset)
static void static void
set_param_references(PlannerInfo *root, Plan *plan) set_param_references(PlannerInfo *root, Plan *plan)
{ {
Assert(IsA(plan, Gather) || IsA(plan, GatherMerge)); Assert(IsA(plan, Gather) ||IsA(plan, GatherMerge));
if (plan->lefttree->extParam) if (plan->lefttree->extParam)
{ {

View File

@ -1118,7 +1118,7 @@ is_parallel_safe(PlannerInfo *root, Node *node)
foreach(l2, initsubplan->setParam) foreach(l2, initsubplan->setParam)
context.safe_param_ids = lcons_int(lfirst_int(l2), context.safe_param_ids = lcons_int(lfirst_int(l2),
context.safe_param_ids); context.safe_param_ids);
} }
} }

View File

@ -2412,7 +2412,7 @@ apply_projection_to_path(PlannerInfo *root,
* workers can help project. But if there is something that is not * workers can help project. But if there is something that is not
* parallel-safe in the target expressions, then we can't. * parallel-safe in the target expressions, then we can't.
*/ */
if ((IsA(path, GatherPath) || IsA(path, GatherMergePath)) && if ((IsA(path, GatherPath) ||IsA(path, GatherMergePath)) &&
is_parallel_safe(root, (Node *) target->exprs)) is_parallel_safe(root, (Node *) target->exprs))
{ {
/* /*
@ -2421,9 +2421,9 @@ apply_projection_to_path(PlannerInfo *root,
* It seems unlikely at present that there could be any other * It seems unlikely at present that there could be any other
* references to the subpath, but better safe than sorry. * references to the subpath, but better safe than sorry.
* *
* Note that we don't change the parallel path's cost estimates; it might * Note that we don't change the parallel path's cost estimates; it
* be appropriate to do so, to reflect the fact that the bulk of the * might be appropriate to do so, to reflect the fact that the bulk of
* target evaluation will happen in workers. * the target evaluation will happen in workers.
*/ */
if (IsA(path, GatherPath)) if (IsA(path, GatherPath))
{ {

View File

@ -1825,7 +1825,7 @@ set_relation_partition_info(PlannerInfo *root, RelOptInfo *rel,
Relation relation) Relation relation)
{ {
PartitionDesc partdesc; PartitionDesc partdesc;
PartitionKey partkey; PartitionKey partkey;
Assert(relation->rd_rel->relkind == RELKIND_PARTITIONED_TABLE); Assert(relation->rd_rel->relkind == RELKIND_PARTITIONED_TABLE);
@ -1890,8 +1890,8 @@ find_partition_scheme(PlannerInfo *root, Relation relation)
/* /*
* Did not find matching partition scheme. Create one copying relevant * Did not find matching partition scheme. Create one copying relevant
* information from the relcache. We need to copy the contents of the array * information from the relcache. We need to copy the contents of the
* since the relcache entry may not survive after we have closed the * array since the relcache entry may not survive after we have closed the
* relation. * relation.
*/ */
part_scheme = (PartitionScheme) palloc0(sizeof(PartitionSchemeData)); part_scheme = (PartitionScheme) palloc0(sizeof(PartitionSchemeData));

View File

@ -873,11 +873,11 @@ build_joinrel_tlist(PlannerInfo *root, RelOptInfo *joinrel,
continue; continue;
/* /*
* Otherwise, anything in a baserel or joinrel targetlist ought to be a * Otherwise, anything in a baserel or joinrel targetlist ought to be
* Var. Children of a partitioned table may have ConvertRowtypeExpr * a Var. Children of a partitioned table may have ConvertRowtypeExpr
* translating whole-row Var of a child to that of the parent. Children * translating whole-row Var of a child to that of the parent.
* of an inherited table or subquery child rels can not directly * Children of an inherited table or subquery child rels can not
* participate in a join, so other kinds of nodes here. * directly participate in a join, so other kinds of nodes here.
*/ */
if (IsA(var, Var)) if (IsA(var, Var))
{ {
@ -901,7 +901,7 @@ build_joinrel_tlist(PlannerInfo *root, RelOptInfo *joinrel,
child_expr = (ConvertRowtypeExpr *) childvar; child_expr = (ConvertRowtypeExpr *) childvar;
childvar = (Var *) child_expr->arg; childvar = (Var *) child_expr->arg;
} }
Assert(IsA(childvar, Var) && childvar->varattno == 0); Assert(IsA(childvar, Var) &&childvar->varattno == 0);
baserel = find_base_rel(root, childvar->varno); baserel = find_base_rel(root, childvar->varno);
ndx = 0 - baserel->min_attr; ndx = 0 - baserel->min_attr;
@ -1666,18 +1666,19 @@ build_joinrel_partition_info(RelOptInfo *joinrel, RelOptInfo *outer_rel,
partnatts = joinrel->part_scheme->partnatts; partnatts = joinrel->part_scheme->partnatts;
joinrel->partexprs = (List **) palloc0(sizeof(List *) * partnatts); joinrel->partexprs = (List **) palloc0(sizeof(List *) * partnatts);
joinrel->nullable_partexprs = joinrel->nullable_partexprs =
(List **) palloc0(sizeof(List *) *partnatts); (List **) palloc0(sizeof(List *) * partnatts);
/* /*
* Construct partition keys for the join. * Construct partition keys for the join.
* *
* An INNER join between two partitioned relations can be regarded as * An INNER join between two partitioned relations can be regarded as
* partitioned by either key expression. For example, A INNER JOIN B ON A.a = * partitioned by either key expression. For example, A INNER JOIN B ON
* B.b can be regarded as partitioned on A.a or on B.b; they are equivalent. * A.a = B.b can be regarded as partitioned on A.a or on B.b; they are
* equivalent.
* *
* For a SEMI or ANTI join, the result can only be regarded as being * For a SEMI or ANTI join, the result can only be regarded as being
* partitioned in the same manner as the outer side, since the inner columns * partitioned in the same manner as the outer side, since the inner
* are not retained. * columns are not retained.
* *
* An OUTER join like (A LEFT JOIN B ON A.a = B.b) may produce rows with * An OUTER join like (A LEFT JOIN B ON A.a = B.b) may produce rows with
* B.b NULL. These rows may not fit the partitioning conditions imposed on * B.b NULL. These rows may not fit the partitioning conditions imposed on
@ -1686,11 +1687,12 @@ build_joinrel_partition_info(RelOptInfo *joinrel, RelOptInfo *outer_rel,
* expressions from the OUTER side only. However, because all * expressions from the OUTER side only. However, because all
* commonly-used comparison operators are strict, the presence of nulls on * commonly-used comparison operators are strict, the presence of nulls on
* the outer side doesn't cause any problem; they can't match anything at * the outer side doesn't cause any problem; they can't match anything at
* future join levels anyway. Therefore, we track two sets of expressions: * future join levels anyway. Therefore, we track two sets of
* those that authentically partition the relation (partexprs) and those * expressions: those that authentically partition the relation
* that partition the relation with the exception that extra nulls may be * (partexprs) and those that partition the relation with the exception
* present (nullable_partexprs). When the comparison operator is strict, * that extra nulls may be present (nullable_partexprs). When the
* the latter is just as good as the former. * comparison operator is strict, the latter is just as good as the
* former.
*/ */
for (cnt = 0; cnt < partnatts; cnt++) for (cnt = 0; cnt < partnatts; cnt++)
{ {

View File

@ -1253,7 +1253,7 @@ GetBackgroundWorkerTypeByPid(pid_t pid)
{ {
int slotno; int slotno;
bool found = false; bool found = false;
static char result[BGW_MAXLEN]; static char result[BGW_MAXLEN];
LWLockAcquire(BackgroundWorkerLock, LW_SHARED); LWLockAcquire(BackgroundWorkerLock, LW_SHARED);

View File

@ -2161,8 +2161,8 @@ retry1:
/* /*
* If the client requested a newer protocol version or if the client * If the client requested a newer protocol version or if the client
* requested any protocol options we didn't recognize, let them know * requested any protocol options we didn't recognize, let them know
* the newest minor protocol version we do support and the names of any * the newest minor protocol version we do support and the names of
* unrecognized options. * any unrecognized options.
*/ */
if (PG_PROTOCOL_MINOR(proto) > PG_PROTOCOL_MINOR(PG_PROTOCOL_LATEST) || if (PG_PROTOCOL_MINOR(proto) > PG_PROTOCOL_MINOR(PG_PROTOCOL_LATEST) ||
unrecognized_protocol_options != NIL) unrecognized_protocol_options != NIL)
@ -4316,8 +4316,8 @@ BackendInitialize(Port *port)
* *
* postgres: walsender <user> <host> <activity> * postgres: walsender <user> <host> <activity>
* *
* To achieve that, we pass "walsender" as username and username * To achieve that, we pass "walsender" as username and username as dbname
* as dbname to init_ps_display(). XXX: should add a new variant of * to init_ps_display(). XXX: should add a new variant of
* init_ps_display() to avoid abusing the parameters like this. * init_ps_display() to avoid abusing the parameters like this.
*/ */
if (am_walsender) if (am_walsender)

View File

@ -278,7 +278,7 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir)
/* Send CopyOutResponse message */ /* Send CopyOutResponse message */
pq_beginmessage(&buf, 'H'); pq_beginmessage(&buf, 'H');
pq_sendbyte(&buf, 0); /* overall format */ pq_sendbyte(&buf, 0); /* overall format */
pq_sendint16(&buf, 0); /* natts */ pq_sendint16(&buf, 0); /* natts */
pq_endmessage(&buf); pq_endmessage(&buf);
if (ti->path == NULL) if (ti->path == NULL)
@ -744,7 +744,7 @@ SendBackupHeader(List *tablespaces)
pq_sendstring(&buf, "spcoid"); pq_sendstring(&buf, "spcoid");
pq_sendint32(&buf, 0); /* table oid */ pq_sendint32(&buf, 0); /* table oid */
pq_sendint16(&buf, 0); /* attnum */ pq_sendint16(&buf, 0); /* attnum */
pq_sendint32(&buf, OIDOID); /* type oid */ pq_sendint32(&buf, OIDOID); /* type oid */
pq_sendint16(&buf, 4); /* typlen */ pq_sendint16(&buf, 4); /* typlen */
pq_sendint32(&buf, 0); /* typmod */ pq_sendint32(&buf, 0); /* typmod */
pq_sendint16(&buf, 0); /* format code */ pq_sendint16(&buf, 0); /* format code */
@ -774,10 +774,10 @@ SendBackupHeader(List *tablespaces)
/* Send one datarow message */ /* Send one datarow message */
pq_beginmessage(&buf, 'D'); pq_beginmessage(&buf, 'D');
pq_sendint16(&buf, 3); /* number of columns */ pq_sendint16(&buf, 3); /* number of columns */
if (ti->path == NULL) if (ti->path == NULL)
{ {
pq_sendint32(&buf, -1); /* Length = -1 ==> NULL */ pq_sendint32(&buf, -1); /* Length = -1 ==> NULL */
pq_sendint32(&buf, -1); pq_sendint32(&buf, -1);
} }
else else
@ -795,7 +795,7 @@ SendBackupHeader(List *tablespaces)
if (ti->size >= 0) if (ti->size >= 0)
send_int8_string(&buf, ti->size / 1024); send_int8_string(&buf, ti->size / 1024);
else else
pq_sendint32(&buf, -1); /* NULL */ pq_sendint32(&buf, -1); /* NULL */
pq_endmessage(&buf); pq_endmessage(&buf);
} }

View File

@ -246,8 +246,8 @@ ReorderBufferAllocate(void)
sizeof(ReorderBufferTXN)); sizeof(ReorderBufferTXN));
buffer->tup_context = GenerationContextCreate(new_ctx, buffer->tup_context = GenerationContextCreate(new_ctx,
"Tuples", "Tuples",
SLAB_LARGE_BLOCK_SIZE); SLAB_LARGE_BLOCK_SIZE);
hash_ctl.keysize = sizeof(TransactionId); hash_ctl.keysize = sizeof(TransactionId);
hash_ctl.entrysize = sizeof(ReorderBufferTXNByIdEnt); hash_ctl.entrysize = sizeof(ReorderBufferTXNByIdEnt);

View File

@ -601,7 +601,7 @@ smgrextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
char *buffer, bool skipFsync) char *buffer, bool skipFsync)
{ {
smgrsw[reln->smgr_which].smgr_extend(reln, forknum, blocknum, smgrsw[reln->smgr_which].smgr_extend(reln, forknum, blocknum,
buffer, skipFsync); buffer, skipFsync);
} }
/* /*
@ -648,7 +648,7 @@ smgrwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
char *buffer, bool skipFsync) char *buffer, bool skipFsync)
{ {
smgrsw[reln->smgr_which].smgr_write(reln, forknum, blocknum, smgrsw[reln->smgr_which].smgr_write(reln, forknum, blocknum,
buffer, skipFsync); buffer, skipFsync);
} }
@ -661,7 +661,7 @@ smgrwriteback(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
BlockNumber nblocks) BlockNumber nblocks)
{ {
smgrsw[reln->smgr_which].smgr_writeback(reln, forknum, blocknum, smgrsw[reln->smgr_which].smgr_writeback(reln, forknum, blocknum,
nblocks); nblocks);
} }
/* /*

View File

@ -2374,8 +2374,8 @@ exec_describe_statement_message(const char *stmt_name)
/* /*
* First describe the parameters... * First describe the parameters...
*/ */
pq_beginmessage_reuse(&row_description_buf, 't'); /* parameter description pq_beginmessage_reuse(&row_description_buf, 't'); /* parameter description
* message type */ * message type */
pq_sendint16(&row_description_buf, psrc->num_params); pq_sendint16(&row_description_buf, psrc->num_params);
for (i = 0; i < psrc->num_params; i++) for (i = 0; i < psrc->num_params; i++)
@ -2952,14 +2952,14 @@ ProcessInterrupts(void)
/* /*
* Don't allow query cancel interrupts while reading input from the * Don't allow query cancel interrupts while reading input from the
* client, because we might lose sync in the FE/BE protocol. (Die * client, because we might lose sync in the FE/BE protocol. (Die
* interrupts are OK, because we won't read any further messages from * interrupts are OK, because we won't read any further messages from the
* the client in that case.) * client in that case.)
*/ */
if (QueryCancelPending && QueryCancelHoldoffCount != 0) if (QueryCancelPending && QueryCancelHoldoffCount != 0)
{ {
/* /*
* Re-arm InterruptPending so that we process the cancel request * Re-arm InterruptPending so that we process the cancel request as
* as soon as we're done reading the message. * soon as we're done reading the message.
*/ */
InterruptPending = true; InterruptPending = true;
} }
@ -4494,10 +4494,10 @@ ShowUsage(const char *title)
appendStringInfo(&str, appendStringInfo(&str,
"!\t%ld kB max resident size\n", "!\t%ld kB max resident size\n",
#if defined(__darwin__) #if defined(__darwin__)
/* in bytes on macOS */ /* in bytes on macOS */
r.ru_maxrss/1024 r.ru_maxrss / 1024
#else #else
/* in kilobytes on most other platforms */ /* in kilobytes on most other platforms */
r.ru_maxrss r.ru_maxrss
#endif #endif
); );

View File

@ -202,7 +202,7 @@ static int
cmpspellaffix(const void *s1, const void *s2) cmpspellaffix(const void *s1, const void *s2)
{ {
return strcmp((*(SPELL *const *) s1)->p.flag, return strcmp((*(SPELL *const *) s1)->p.flag,
(*(SPELL *const *) s2)->p.flag); (*(SPELL *const *) s2)->p.flag);
} }
static int static int

View File

@ -2231,7 +2231,7 @@ timetz_hash_extended(PG_FUNCTION_ARGS)
Int64GetDatumFast(key->time), Int64GetDatumFast(key->time),
seed)); seed));
thash ^= DatumGetUInt64(hash_uint32_extended(key->zone, thash ^= DatumGetUInt64(hash_uint32_extended(key->zone,
DatumGetInt64(seed))); DatumGetInt64(seed)));
PG_RETURN_UINT64(thash); PG_RETURN_UINT64(thash);
} }

View File

@ -921,8 +921,8 @@ pg_stat_get_backend_activity(PG_FUNCTION_ARGS)
int32 beid = PG_GETARG_INT32(0); int32 beid = PG_GETARG_INT32(0);
PgBackendStatus *beentry; PgBackendStatus *beentry;
const char *activity; const char *activity;
char *clipped_activity; char *clipped_activity;
text *ret; text *ret;
if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL) if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL)
activity = "<backend information not available>"; activity = "<backend information not available>";

View File

@ -46,7 +46,7 @@
#define Generation_BLOCKHDRSZ MAXALIGN(sizeof(GenerationBlock)) #define Generation_BLOCKHDRSZ MAXALIGN(sizeof(GenerationBlock))
#define Generation_CHUNKHDRSZ sizeof(GenerationChunk) #define Generation_CHUNKHDRSZ sizeof(GenerationChunk)
typedef struct GenerationBlock GenerationBlock; /* forward reference */ typedef struct GenerationBlock GenerationBlock; /* forward reference */
typedef struct GenerationChunk GenerationChunk; typedef struct GenerationChunk GenerationChunk;
typedef void *GenerationPointer; typedef void *GenerationPointer;
@ -62,9 +62,9 @@ typedef struct GenerationContext
/* Generational context parameters */ /* Generational context parameters */
Size blockSize; /* standard block size */ Size blockSize; /* standard block size */
GenerationBlock *block; /* current (most recently allocated) block */ GenerationBlock *block; /* current (most recently allocated) block */
dlist_head blocks; /* list of blocks */ dlist_head blocks; /* list of blocks */
} GenerationContext; } GenerationContext;
/* /*
* GenerationBlock * GenerationBlock
@ -155,7 +155,7 @@ static void GenerationDelete(MemoryContext context);
static Size GenerationGetChunkSpace(MemoryContext context, void *pointer); static Size GenerationGetChunkSpace(MemoryContext context, void *pointer);
static bool GenerationIsEmpty(MemoryContext context); static bool GenerationIsEmpty(MemoryContext context);
static void GenerationStats(MemoryContext context, int level, bool print, static void GenerationStats(MemoryContext context, int level, bool print,
MemoryContextCounters *totals); MemoryContextCounters *totals);
#ifdef MEMORY_CONTEXT_CHECKING #ifdef MEMORY_CONTEXT_CHECKING
static void GenerationCheck(MemoryContext context); static void GenerationCheck(MemoryContext context);
@ -207,10 +207,10 @@ static MemoryContextMethods GenerationMethods = {
*/ */
MemoryContext MemoryContext
GenerationContextCreate(MemoryContext parent, GenerationContextCreate(MemoryContext parent,
const char *name, const char *name,
Size blockSize) Size blockSize)
{ {
GenerationContext *set; GenerationContext *set;
/* Assert we padded GenerationChunk properly */ /* Assert we padded GenerationChunk properly */
StaticAssertStmt(Generation_CHUNKHDRSZ == MAXALIGN(Generation_CHUNKHDRSZ), StaticAssertStmt(Generation_CHUNKHDRSZ == MAXALIGN(Generation_CHUNKHDRSZ),
@ -233,10 +233,10 @@ GenerationContextCreate(MemoryContext parent,
/* Do the type-independent part of context creation */ /* Do the type-independent part of context creation */
set = (GenerationContext *) MemoryContextCreate(T_GenerationContext, set = (GenerationContext *) MemoryContextCreate(T_GenerationContext,
sizeof(GenerationContext), sizeof(GenerationContext),
&GenerationMethods, &GenerationMethods,
parent, parent,
name); name);
set->blockSize = blockSize; set->blockSize = blockSize;
@ -250,7 +250,7 @@ GenerationContextCreate(MemoryContext parent,
static void static void
GenerationInit(MemoryContext context) GenerationInit(MemoryContext context)
{ {
GenerationContext *set = (GenerationContext *) context; GenerationContext *set = (GenerationContext *) context;
set->block = NULL; set->block = NULL;
dlist_init(&set->blocks); dlist_init(&set->blocks);
@ -266,7 +266,7 @@ GenerationInit(MemoryContext context)
static void static void
GenerationReset(MemoryContext context) GenerationReset(MemoryContext context)
{ {
GenerationContext *set = (GenerationContext *) context; GenerationContext *set = (GenerationContext *) context;
dlist_mutable_iter miter; dlist_mutable_iter miter;
AssertArg(GenerationIsValid(set)); AssertArg(GenerationIsValid(set));
@ -324,9 +324,9 @@ GenerationDelete(MemoryContext context)
static void * static void *
GenerationAlloc(MemoryContext context, Size size) GenerationAlloc(MemoryContext context, Size size)
{ {
GenerationContext *set = (GenerationContext *) context; GenerationContext *set = (GenerationContext *) context;
GenerationBlock *block; GenerationBlock *block;
GenerationChunk *chunk; GenerationChunk *chunk;
Size chunk_size = MAXALIGN(size); Size chunk_size = MAXALIGN(size);
/* is it an over-sized chunk? if yes, allocate special block */ /* is it an over-sized chunk? if yes, allocate special block */
@ -460,9 +460,9 @@ GenerationAlloc(MemoryContext context, Size size)
static void static void
GenerationFree(MemoryContext context, void *pointer) GenerationFree(MemoryContext context, void *pointer)
{ {
GenerationContext *set = (GenerationContext *) context; GenerationContext *set = (GenerationContext *) context;
GenerationChunk *chunk = GenerationPointerGetChunk(pointer); GenerationChunk *chunk = GenerationPointerGetChunk(pointer);
GenerationBlock *block; GenerationBlock *block;
/* Allow access to private part of chunk header. */ /* Allow access to private part of chunk header. */
VALGRIND_MAKE_MEM_DEFINED(chunk, GENERATIONCHUNK_PRIVATE_LEN); VALGRIND_MAKE_MEM_DEFINED(chunk, GENERATIONCHUNK_PRIVATE_LEN);
@ -474,7 +474,7 @@ GenerationFree(MemoryContext context, void *pointer)
if (chunk->requested_size < chunk->size) if (chunk->requested_size < chunk->size)
if (!sentinel_ok(pointer, chunk->requested_size)) if (!sentinel_ok(pointer, chunk->requested_size))
elog(WARNING, "detected write past chunk end in %s %p", elog(WARNING, "detected write past chunk end in %s %p",
((MemoryContext)set)->name, chunk); ((MemoryContext) set)->name, chunk);
#endif #endif
#ifdef CLOBBER_FREED_MEMORY #ifdef CLOBBER_FREED_MEMORY
@ -520,9 +520,9 @@ GenerationFree(MemoryContext context, void *pointer)
static void * static void *
GenerationRealloc(MemoryContext context, void *pointer, Size size) GenerationRealloc(MemoryContext context, void *pointer, Size size)
{ {
GenerationContext *set = (GenerationContext *) context; GenerationContext *set = (GenerationContext *) context;
GenerationChunk *chunk = GenerationPointerGetChunk(pointer); GenerationChunk *chunk = GenerationPointerGetChunk(pointer);
GenerationPointer newPointer; GenerationPointer newPointer;
Size oldsize; Size oldsize;
/* Allow access to private part of chunk header. */ /* Allow access to private part of chunk header. */
@ -535,7 +535,7 @@ GenerationRealloc(MemoryContext context, void *pointer, Size size)
if (chunk->requested_size < oldsize) if (chunk->requested_size < oldsize)
if (!sentinel_ok(pointer, chunk->requested_size)) if (!sentinel_ok(pointer, chunk->requested_size))
elog(WARNING, "detected write past chunk end in %s %p", elog(WARNING, "detected write past chunk end in %s %p",
((MemoryContext)set)->name, chunk); ((MemoryContext) set)->name, chunk);
#endif #endif
/* /*
@ -652,7 +652,7 @@ GenerationGetChunkSpace(MemoryContext context, void *pointer)
static bool static bool
GenerationIsEmpty(MemoryContext context) GenerationIsEmpty(MemoryContext context)
{ {
GenerationContext *set = (GenerationContext *) context; GenerationContext *set = (GenerationContext *) context;
return dlist_is_empty(&set->blocks); return dlist_is_empty(&set->blocks);
} }
@ -670,9 +670,9 @@ GenerationIsEmpty(MemoryContext context)
*/ */
static void static void
GenerationStats(MemoryContext context, int level, bool print, GenerationStats(MemoryContext context, int level, bool print,
MemoryContextCounters *totals) MemoryContextCounters *totals)
{ {
GenerationContext *set = (GenerationContext *) context; GenerationContext *set = (GenerationContext *) context;
Size nblocks = 0; Size nblocks = 0;
Size nchunks = 0; Size nchunks = 0;
Size nfreechunks = 0; Size nfreechunks = 0;
@ -698,8 +698,8 @@ GenerationStats(MemoryContext context, int level, bool print,
for (i = 0; i < level; i++) for (i = 0; i < level; i++)
fprintf(stderr, " "); fprintf(stderr, " ");
fprintf(stderr, fprintf(stderr,
"Generation: %s: %zu total in %zd blocks (%zd chunks); %zu free (%zd chunks); %zu used\n", "Generation: %s: %zu total in %zd blocks (%zd chunks); %zu free (%zd chunks); %zu used\n",
((MemoryContext)set)->name, totalspace, nblocks, nchunks, freespace, ((MemoryContext) set)->name, totalspace, nblocks, nchunks, freespace,
nfreechunks, totalspace - freespace); nfreechunks, totalspace - freespace);
} }
@ -726,7 +726,7 @@ GenerationStats(MemoryContext context, int level, bool print,
static void static void
GenerationCheck(MemoryContext context) GenerationCheck(MemoryContext context)
{ {
GenerationContext *gen = (GenerationContext *) context; GenerationContext *gen = (GenerationContext *) context;
char *name = context->name; char *name = context->name;
dlist_iter iter; dlist_iter iter;
@ -818,4 +818,4 @@ GenerationCheck(MemoryContext context)
} }
} }
#endif /* MEMORY_CONTEXT_CHECKING */ #endif /* MEMORY_CONTEXT_CHECKING */

View File

@ -1591,8 +1591,7 @@ puttuple_common(Tuplesortstate *state, SortTuple *tuple)
case TSS_BUILDRUNS: case TSS_BUILDRUNS:
/* /*
* Save the tuple into the unsorted array (there must be * Save the tuple into the unsorted array (there must be space)
* space)
*/ */
state->memtuples[state->memtupcount++] = *tuple; state->memtuples[state->memtupcount++] = *tuple;
@ -2742,8 +2741,8 @@ dumptuples(Tuplesortstate *state, bool alltuples)
int i; int i;
/* /*
* Nothing to do if we still fit in available memory and have array * Nothing to do if we still fit in available memory and have array slots,
* slots, unless this is the final call during initial run generation. * unless this is the final call during initial run generation.
*/ */
if (state->memtupcount < state->memtupsize && !LACKMEM(state) && if (state->memtupcount < state->memtupsize && !LACKMEM(state) &&
!alltuples) !alltuples)

View File

@ -148,7 +148,7 @@ static int wal_segment_size_mb;
/* internal vars */ /* internal vars */
static const char *progname; static const char *progname;
static int encodingid; static int encodingid;
static char *bki_file; static char *bki_file;
static char *desc_file; static char *desc_file;
static char *shdesc_file; static char *shdesc_file;
@ -239,7 +239,7 @@ static void writefile(char *path, char **lines);
static FILE *popen_check(const char *command, const char *mode); static FILE *popen_check(const char *command, const char *mode);
static void exit_nicely(void) pg_attribute_noreturn(); static void exit_nicely(void) pg_attribute_noreturn();
static char *get_id(void); static char *get_id(void);
static int get_encoding_id(const char *encoding_name); static int get_encoding_id(const char *encoding_name);
static void set_input(char **dest, const char *filename); static void set_input(char **dest, const char *filename);
static void check_input(char *path); static void check_input(char *path);
static void write_version_file(const char *extrapath); static void write_version_file(const char *extrapath);

View File

@ -496,7 +496,8 @@ main(int argc, char **argv)
int c; int c;
int option_index; int option_index;
char *db_name; char *db_name;
uint32 hi, lo; uint32 hi,
lo;
progname = get_progname(argv[0]); progname = get_progname(argv[0]);
set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_basebackup")); set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_basebackup"));

View File

@ -33,9 +33,9 @@ extern PGconn *GetConnection(void);
/* Replication commands */ /* Replication commands */
extern bool CreateReplicationSlot(PGconn *conn, const char *slot_name, extern bool CreateReplicationSlot(PGconn *conn, const char *slot_name,
const char *plugin, bool is_temporary, const char *plugin, bool is_temporary,
bool is_physical, bool reserve_wal, bool is_physical, bool reserve_wal,
bool slot_exists_ok); bool slot_exists_ok);
extern bool DropReplicationSlot(PGconn *conn, const char *slot_name); extern bool DropReplicationSlot(PGconn *conn, const char *slot_name);
extern bool RunIdentifySystem(PGconn *conn, char **sysid, extern bool RunIdentifySystem(PGconn *conn, char **sysid,
TimeLineID *starttli, TimeLineID *starttli,

View File

@ -2939,7 +2939,7 @@ describeOneTableDetails(const char *schemaname,
} }
else else
{ {
char *partitioned_note; char *partitioned_note;
if (*PQgetvalue(result, i, 2) == RELKIND_PARTITIONED_TABLE) if (*PQgetvalue(result, i, 2) == RELKIND_PARTITIONED_TABLE)
partitioned_note = ", PARTITIONED"; partitioned_note = ", PARTITIONED";

View File

@ -133,7 +133,7 @@ typedef struct HashScanPosData
int itemIndex; /* current index in items[] */ int itemIndex; /* current index in items[] */
HashScanPosItem items[MaxIndexTuplesPerPage]; /* MUST BE LAST */ HashScanPosItem items[MaxIndexTuplesPerPage]; /* MUST BE LAST */
} HashScanPosData; } HashScanPosData;
#define HashScanPosIsPinned(scanpos) \ #define HashScanPosIsPinned(scanpos) \
( \ ( \

View File

@ -69,6 +69,6 @@ extern List *get_proposed_default_constraint(List *new_part_constaints);
/* For tuple routing */ /* For tuple routing */
extern int get_partition_for_tuple(Relation relation, Datum *values, extern int get_partition_for_tuple(Relation relation, Datum *values,
bool *isnull); bool *isnull);
#endif /* PARTITION_H */ #endif /* PARTITION_H */

View File

@ -28,7 +28,7 @@ typedef struct ParallelExecutorInfo
BufferUsage *buffer_usage; /* points to bufusage area in DSM */ BufferUsage *buffer_usage; /* points to bufusage area in DSM */
SharedExecutorInstrumentation *instrumentation; /* optional */ SharedExecutorInstrumentation *instrumentation; /* optional */
dsa_area *area; /* points to DSA area in DSM */ dsa_area *area; /* points to DSA area in DSM */
dsa_pointer param_exec; /* serialized PARAM_EXEC parameters */ dsa_pointer param_exec; /* serialized PARAM_EXEC parameters */
bool finished; /* set true by ExecParallelFinish */ bool finished; /* set true by ExecParallelFinish */
/* These two arrays have pcxt->nworkers_launched entries: */ /* These two arrays have pcxt->nworkers_launched entries: */
shm_mq_handle **tqueue; /* tuple queues for worker output */ shm_mq_handle **tqueue; /* tuple queues for worker output */

View File

@ -38,13 +38,13 @@
*/ */
typedef struct PartitionDispatchData typedef struct PartitionDispatchData
{ {
Relation reldesc; Relation reldesc;
PartitionKey key; PartitionKey key;
List *keystate; /* list of ExprState */ List *keystate; /* list of ExprState */
PartitionDesc partdesc; PartitionDesc partdesc;
TupleTableSlot *tupslot; TupleTableSlot *tupslot;
TupleConversionMap *tupmap; TupleConversionMap *tupmap;
int *indexes; int *indexes;
} PartitionDispatchData; } PartitionDispatchData;
typedef struct PartitionDispatchData *PartitionDispatch; typedef struct PartitionDispatchData *PartitionDispatch;

View File

@ -143,6 +143,6 @@ extern void psqlscan_escape_variable(PsqlScanState state,
const char *txt, int len, const char *txt, int len,
PsqlScanQuoteType quote); PsqlScanQuoteType quote);
extern void psqlscan_test_variable(PsqlScanState state, extern void psqlscan_test_variable(PsqlScanState state,
const char *txt, int len); const char *txt, int len);
#endif /* PSQLSCAN_INT_H */ #endif /* PSQLSCAN_INT_H */

View File

@ -81,7 +81,7 @@ extern void dshash_delete_entry(dshash_table *hash_table, void *entry);
extern void dshash_release_lock(dshash_table *hash_table, void *entry); extern void dshash_release_lock(dshash_table *hash_table, void *entry);
/* Convenience hash and compare functions wrapping memcmp and tag_hash. */ /* Convenience hash and compare functions wrapping memcmp and tag_hash. */
extern int dshash_memcmp(const void *a, const void *b, size_t size, void *arg); extern int dshash_memcmp(const void *a, const void *b, size_t size, void *arg);
extern dshash_hash dshash_memhash(const void *v, size_t size, void *arg); extern dshash_hash dshash_memhash(const void *v, size_t size, void *arg);
/* Debugging support. */ /* Debugging support. */

View File

@ -149,7 +149,7 @@ extern void appendBinaryStringInfo(StringInfo str,
* if necessary. Does not ensure a trailing null-byte exists. * if necessary. Does not ensure a trailing null-byte exists.
*/ */
extern void appendBinaryStringInfoNT(StringInfo str, extern void appendBinaryStringInfoNT(StringInfo str,
const char *data, int datalen); const char *data, int datalen);
/*------------------------ /*------------------------
* enlargeStringInfo * enlargeStringInfo

View File

@ -15,7 +15,7 @@
/* Name of SCRAM mechanisms per IANA */ /* Name of SCRAM mechanisms per IANA */
#define SCRAM_SHA256_NAME "SCRAM-SHA-256" #define SCRAM_SHA256_NAME "SCRAM-SHA-256"
#define SCRAM_SHA256_PLUS_NAME "SCRAM-SHA-256-PLUS" /* with channel binding */ #define SCRAM_SHA256_PLUS_NAME "SCRAM-SHA-256-PLUS" /* with channel binding */
/* Channel binding types */ /* Channel binding types */
#define SCRAM_CHANNEL_BINDING_TLS_UNIQUE "tls-unique" #define SCRAM_CHANNEL_BINDING_TLS_UNIQUE "tls-unique"
@ -27,8 +27,8 @@
/* Routines dedicated to authentication */ /* Routines dedicated to authentication */
extern void *pg_be_scram_init(const char *username, const char *shadow_pass, extern void *pg_be_scram_init(const char *username, const char *shadow_pass,
bool ssl_in_use, const char *tls_finished_message, bool ssl_in_use, const char *tls_finished_message,
size_t tls_finished_len); size_t tls_finished_len);
extern int pg_be_scram_exchange(void *opaq, char *input, int inputlen, extern int pg_be_scram_exchange(void *opaq, char *input, int inputlen,
char **output, int *outputlen, char **logdetail); char **output, int *outputlen, char **logdetail);

View File

@ -660,7 +660,7 @@ typedef struct RelOptInfo
struct RelOptInfo **part_rels; /* Array of RelOptInfos of partitions, struct RelOptInfo **part_rels; /* Array of RelOptInfos of partitions,
* stored in the same order of bounds */ * stored in the same order of bounds */
List **partexprs; /* Non-nullable partition key expressions. */ List **partexprs; /* Non-nullable partition key expressions. */
List **nullable_partexprs; /* Nullable partition key expressions. */ List **nullable_partexprs; /* Nullable partition key expressions. */
} RelOptInfo; } RelOptInfo;
/* /*

View File

@ -245,7 +245,7 @@ extern bool log_btree_build_stats;
extern PGDLLIMPORT bool check_function_bodies; extern PGDLLIMPORT bool check_function_bodies;
extern bool default_with_oids; extern bool default_with_oids;
extern bool session_auth_is_superuser; extern bool session_auth_is_superuser;
extern int log_min_error_statement; extern int log_min_error_statement;
extern int log_min_messages; extern int log_min_messages;

View File

@ -157,8 +157,8 @@ extern MemoryContext SlabContextCreate(MemoryContext parent,
/* generation.c */ /* generation.c */
extern MemoryContext GenerationContextCreate(MemoryContext parent, extern MemoryContext GenerationContextCreate(MemoryContext parent,
const char *name, const char *name,
Size blockSize); Size blockSize);
/* /*
* Recommended default alloc parameters, suitable for "ordinary" contexts * Recommended default alloc parameters, suitable for "ordinary" contexts

View File

@ -55,7 +55,8 @@ garbage_left(enum ARRAY_TYPE isarray, char **scan_length, enum COMPAT_MODE compa
if (INFORMIX_MODE(compat) && **scan_length == '.') if (INFORMIX_MODE(compat) && **scan_length == '.')
{ {
/* skip invalid characters */ /* skip invalid characters */
do { do
{
(*scan_length)++; (*scan_length)++;
} while (isdigit((unsigned char) **scan_length)); } while (isdigit((unsigned char) **scan_length));
} }

View File

@ -1109,7 +1109,7 @@ ecpg_build_params(struct statement *stmt)
struct variable *var; struct variable *var;
int desc_counter = 0; int desc_counter = 0;
int position = 0; int position = 0;
const char *value; const char *value;
bool std_strings = false; bool std_strings = false;
/* Get standard_conforming_strings setting. */ /* Get standard_conforming_strings setting. */

View File

@ -491,9 +491,9 @@ build_client_final_message(fe_scram_state *state, PQExpBuffer errormessage)
free(cbind_input); free(cbind_input);
} }
else if (state->ssl_in_use) else if (state->ssl_in_use)
appendPQExpBuffer(&buf, "c=eSws"); /* base64 of "y,," */ appendPQExpBuffer(&buf, "c=eSws"); /* base64 of "y,," */
else else
appendPQExpBuffer(&buf, "c=biws"); /* base64 of "n,," */ appendPQExpBuffer(&buf, "c=biws"); /* base64 of "n,," */
if (PQExpBufferDataBroken(buf)) if (PQExpBufferDataBroken(buf))
goto oom_error; goto oom_error;

View File

@ -534,7 +534,7 @@ pg_SASL_init(PGconn *conn, int payloadlen)
*/ */
if (conn->ssl_in_use && if (conn->ssl_in_use &&
strcmp(mechanism_buf.data, SCRAM_SHA256_PLUS_NAME) == 0) strcmp(mechanism_buf.data, SCRAM_SHA256_PLUS_NAME) == 0)
selected_mechanism = SCRAM_SHA256_PLUS_NAME; selected_mechanism = SCRAM_SHA256_PLUS_NAME;
else if (strcmp(mechanism_buf.data, SCRAM_SHA256_NAME) == 0 && else if (strcmp(mechanism_buf.data, SCRAM_SHA256_NAME) == 0 &&
!selected_mechanism) !selected_mechanism)
selected_mechanism = SCRAM_SHA256_NAME; selected_mechanism = SCRAM_SHA256_NAME;
@ -569,6 +569,7 @@ pg_SASL_init(PGconn *conn, int payloadlen)
} }
#ifdef USE_SSL #ifdef USE_SSL
/* /*
* Get data for channel binding. * Get data for channel binding.
*/ */
@ -581,8 +582,8 @@ pg_SASL_init(PGconn *conn, int payloadlen)
#endif #endif
/* /*
* Initialize the SASL state information with all the information * Initialize the SASL state information with all the information gathered
* gathered during the initial exchange. * during the initial exchange.
* *
* Note: Only tls-unique is supported for the moment. * Note: Only tls-unique is supported for the moment.
*/ */

View File

@ -24,11 +24,11 @@ extern char *pg_fe_getauthname(PQExpBuffer errorMessage);
/* Prototypes for functions in fe-auth-scram.c */ /* Prototypes for functions in fe-auth-scram.c */
extern void *pg_fe_scram_init(const char *username, extern void *pg_fe_scram_init(const char *username,
const char *password, const char *password,
bool ssl_in_use, bool ssl_in_use,
const char *sasl_mechanism, const char *sasl_mechanism,
char *tls_finished_message, char *tls_finished_message,
size_t tls_finished_len); size_t tls_finished_len);
extern void pg_fe_scram_free(void *opaq); extern void pg_fe_scram_free(void *opaq);
extern void pg_fe_scram_exchange(void *opaq, char *input, int inputlen, extern void pg_fe_scram_exchange(void *opaq, char *input, int inputlen,
char **output, int *outputlen, char **output, int *outputlen,

View File

@ -6617,8 +6617,8 @@ exec_save_simple_expr(PLpgSQL_expr *expr, CachedPlan *cplan)
if (IsA(tle_expr, Const)) if (IsA(tle_expr, Const))
break; break;
/* Otherwise, it had better be a Param or an outer Var */ /* Otherwise, it had better be a Param or an outer Var */
Assert(IsA(tle_expr, Param) || (IsA(tle_expr, Var) && Assert(IsA(tle_expr, Param) ||(IsA(tle_expr, Var) &&
((Var *) tle_expr)->varno == OUTER_VAR)); ((Var *) tle_expr)->varno == OUTER_VAR));
/* Descend to the child node */ /* Descend to the child node */
plan = plan->lefttree; plan = plan->lefttree;
} }

View File

@ -80,23 +80,23 @@ static volatile int errno2_set = 0;
#ifndef HAVE_STRERROR_R #ifndef HAVE_STRERROR_R
static char *strerror_p1; static char *strerror_p1;
static char *strerror_p2; static char *strerror_p2;
static int strerror_threadsafe = 0; static int strerror_threadsafe = 0;
#endif #endif
#if !defined(WIN32) && !defined(HAVE_GETPWUID_R) #if !defined(WIN32) && !defined(HAVE_GETPWUID_R)
static struct passwd *passwd_p1; static struct passwd *passwd_p1;
static struct passwd *passwd_p2; static struct passwd *passwd_p2;
static int getpwuid_threadsafe = 0; static int getpwuid_threadsafe = 0;
#endif #endif
#if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME_R) #if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME_R)
static struct hostent *hostent_p1; static struct hostent *hostent_p1;
static struct hostent *hostent_p2; static struct hostent *hostent_p2;
static char myhostname[MAXHOSTNAMELEN]; static char myhostname[MAXHOSTNAMELEN];
static int gethostbyname_threadsafe = 0; static int gethostbyname_threadsafe = 0;
#endif #endif
static int platform_is_threadsafe = 1; static int platform_is_threadsafe = 1;
int int
main(int argc, char *argv[]) main(int argc, char *argv[])

View File

@ -34,6 +34,9 @@ AfterTriggerEventList
AfterTriggerShared AfterTriggerShared
AfterTriggerSharedData AfterTriggerSharedData
AfterTriggersData AfterTriggersData
AfterTriggersQueryData
AfterTriggersTableData
AfterTriggersTransData
Agg Agg
AggClauseCosts AggClauseCosts
AggInfo AggInfo
@ -125,7 +128,6 @@ ArrayMetaState
ArrayParseState ArrayParseState
ArrayRef ArrayRef
ArrayRefState ArrayRefState
ArrayRemapInfo
ArrayType ArrayType
AsyncQueueControl AsyncQueueControl
AsyncQueueEntry AsyncQueueEntry
@ -143,7 +145,6 @@ AutoVacOpts
AutoVacuumShmemStruct AutoVacuumShmemStruct
AutoVacuumWorkItem AutoVacuumWorkItem
AutoVacuumWorkItemType AutoVacuumWorkItemType
AutovacWorkItems
AuxProcType AuxProcType
BF_ctx BF_ctx
BF_key BF_key
@ -274,6 +275,8 @@ BuiltinScript
BulkInsertState BulkInsertState
CACHESIGN CACHESIGN
CAC_state CAC_state
CCFastEqualFN
CCHashFN
CEOUC_WAIT_MODE CEOUC_WAIT_MODE
CFuncHashTabEntry CFuncHashTabEntry
CHAR CHAR
@ -302,8 +305,6 @@ CatCache
CatCacheHeader CatCacheHeader
CatalogId CatalogId
CatalogIndexState CatalogIndexState
CCHashFN
CCFastEqualFN
ChangeVarNodes_context ChangeVarNodes_context
CheckPoint CheckPoint
CheckPointStmt CheckPointStmt
@ -344,6 +345,7 @@ ColumnCompareData
ColumnDef ColumnDef
ColumnIOData ColumnIOData
ColumnRef ColumnRef
ColumnsHashData
CombinationGenerator CombinationGenerator
ComboCidEntry ComboCidEntry
ComboCidEntryData ComboCidEntryData
@ -632,9 +634,9 @@ FieldStore
File File
FileFdwExecutionState FileFdwExecutionState
FileFdwPlanState FileFdwPlanState
FileName
FileNameMap FileNameMap
FindSplitData FindSplitData
FixedParallelExecutorState
FixedParallelState FixedParallelState
FixedParamState FixedParamState
FlagMode FlagMode
@ -824,6 +826,10 @@ GatherMergeState
GatherPath GatherPath
GatherState GatherState
Gene Gene
GenerationBlock
GenerationChunk
GenerationContext
GenerationPointer
GenericCosts GenericCosts
GenericXLogState GenericXLogState
GeqoPrivateData GeqoPrivateData
@ -941,6 +947,7 @@ HashPageStat
HashPath HashPath
HashScanOpaque HashScanOpaque
HashScanOpaqueData HashScanOpaqueData
HashScanPosData
HashScanPosItem HashScanPosItem
HashSkewBucket HashSkewBucket
HashState HashState
@ -1021,13 +1028,13 @@ InsertStmt
Instrumentation Instrumentation
Int128AggState Int128AggState
Int8TransTypeData Int8TransTypeData
IntRBTreeNode
InternalDefaultACL InternalDefaultACL
InternalGrant InternalGrant
Interval Interval
IntoClause IntoClause
InvalidationChunk InvalidationChunk
InvalidationListHeader InvalidationListHeader
InvertedWalkNextStep
IpcMemoryId IpcMemoryId
IpcMemoryKey IpcMemoryKey
IpcSemaphoreId IpcSemaphoreId
@ -1217,6 +1224,7 @@ MergeJoinClause
MergeJoinState MergeJoinState
MergePath MergePath
MergeScanSelCache MergeScanSelCache
MetaCommand
MinMaxAggInfo MinMaxAggInfo
MinMaxAggPath MinMaxAggPath
MinMaxExpr MinMaxExpr
@ -1454,13 +1462,18 @@ PLpgSQL_var
PLpgSQL_variable PLpgSQL_variable
PLwdatum PLwdatum
PLword PLword
PLyArrayToOb
PLyCursorObject PLyCursorObject
PLyDatumToOb PLyDatumToOb
PLyDatumToObFunc PLyDatumToObFunc
PLyExceptionEntry PLyExceptionEntry
PLyExecutionContext PLyExecutionContext
PLyObToArray
PLyObToDatum PLyObToDatum
PLyObToDatumFunc PLyObToDatumFunc
PLyObToDomain
PLyObToScalar
PLyObToTransform
PLyObToTuple PLyObToTuple
PLyObject_AsString_t PLyObject_AsString_t
PLyPlanObject PLyPlanObject
@ -1470,12 +1483,11 @@ PLyProcedureKey
PLyResultObject PLyResultObject
PLySRFState PLySRFState
PLySavedArgs PLySavedArgs
PLyScalarToOb
PLySubtransactionData PLySubtransactionData
PLySubtransactionObject PLySubtransactionObject
PLyTransformToOb
PLyTupleToOb PLyTupleToOb
PLyTypeInfo
PLyTypeInput
PLyTypeOutput
PLyUnicode_FromStringAndSize_t PLyUnicode_FromStringAndSize_t
PMINIDUMP_CALLBACK_INFORMATION PMINIDUMP_CALLBACK_INFORMATION
PMINIDUMP_EXCEPTION_INFORMATION PMINIDUMP_EXCEPTION_INFORMATION
@ -1565,12 +1577,13 @@ PartitionDescData
PartitionDispatch PartitionDispatch
PartitionDispatchData PartitionDispatchData
PartitionElem PartitionElem
PartitionKey
PartitionHashBound PartitionHashBound
PartitionKey
PartitionListValue PartitionListValue
PartitionRangeBound PartitionRangeBound
PartitionRangeDatum PartitionRangeDatum
PartitionRangeDatumKind PartitionRangeDatumKind
PartitionScheme
PartitionSpec PartitionSpec
PartitionedChildRelInfo PartitionedChildRelInfo
PasswordType PasswordType
@ -1670,6 +1683,7 @@ Pool
PopulateArrayContext PopulateArrayContext
PopulateArrayState PopulateArrayState
PopulateRecordCache PopulateRecordCache
PopulateRecordsetCache
PopulateRecordsetState PopulateRecordsetState
Port Port
Portal Portal
@ -1781,7 +1795,6 @@ RangeBox
RangeFunction RangeFunction
RangeIOData RangeIOData
RangeQueryClause RangeQueryClause
RangeRemapInfo
RangeSubselect RangeSubselect
RangeTableFunc RangeTableFunc
RangeTableFuncCol RangeTableFuncCol
@ -1794,6 +1807,7 @@ RangeVar
RangeVarGetRelidCallback RangeVarGetRelidCallback
RawColumnDefault RawColumnDefault
RawStmt RawStmt
ReInitializeDSMForeignScan_function
ReScanForeignScan_function ReScanForeignScan_function
ReadBufPtrType ReadBufPtrType
ReadBufferMode ReadBufferMode
@ -1805,8 +1819,6 @@ RecheckForeignScan_function
RecordCacheEntry RecordCacheEntry
RecordCompareData RecordCompareData
RecordIOData RecordIOData
RecordRemapInfo
RecordTypmodMap
RecoveryTargetAction RecoveryTargetAction
RecoveryTargetType RecoveryTargetType
RectBox RectBox
@ -1866,6 +1878,7 @@ ReorderBufferTupleCidEnt
ReorderBufferTupleCidKey ReorderBufferTupleCidKey
ReorderTuple ReorderTuple
RepOriginId RepOriginId
ReparameterizeForeignPathByChild_function
ReplaceVarsFromTargetList_context ReplaceVarsFromTargetList_context
ReplaceVarsNoMatchOption ReplaceVarsNoMatchOption
ReplicaIdentityStmt ReplicaIdentityStmt
@ -2020,9 +2033,10 @@ SharedInvalRelmapMsg
SharedInvalSmgrMsg SharedInvalSmgrMsg
SharedInvalSnapshotMsg SharedInvalSnapshotMsg
SharedInvalidationMessage SharedInvalidationMessage
SharedRecordTableKey
SharedRecordTableEntry SharedRecordTableEntry
SharedRecordTableKey
SharedRecordTypmodRegistry SharedRecordTypmodRegistry
SharedSortInfo
SharedTypmodTableEntry SharedTypmodTableEntry
ShellTypeInfo ShellTypeInfo
ShippableCacheEntry ShippableCacheEntry
@ -2297,9 +2311,10 @@ TupleHashEntryData
TupleHashIterator TupleHashIterator
TupleHashTable TupleHashTable
TupleQueueReader TupleQueueReader
TupleRemapClass
TupleRemapInfo
TupleTableSlot TupleTableSlot
TuplesortInstrumentation
TuplesortMethod
TuplesortSpaceType
Tuplesortstate Tuplesortstate
Tuplestorestate Tuplestorestate
TwoPhaseCallback TwoPhaseCallback
@ -2329,7 +2344,6 @@ UChar
UCharIterator UCharIterator
UCollator UCollator
UConverter UConverter
UEnumeration
UErrorCode UErrorCode
UINT UINT
ULARGE_INTEGER ULARGE_INTEGER
@ -2353,6 +2367,7 @@ UserOpts
VacAttrStats VacAttrStats
VacAttrStatsP VacAttrStatsP
VacuumParams VacuumParams
VacuumRelation
VacuumStmt VacuumStmt
Value Value
ValuesScan ValuesScan
@ -2547,6 +2562,7 @@ bgworker_main_type
binaryheap binaryheap
binaryheap_comparator binaryheap_comparator
bitmapword bitmapword
bits16
bits32 bits32
bits8 bits8
bool bool
@ -2561,7 +2577,6 @@ check_network_data
check_object_relabel_type check_object_relabel_type
check_password_hook_type check_password_hook_type
check_ungrouped_columns_context check_ungrouped_columns_context
chkpass
chr chr
clock_t clock_t
cmpEntriesArg cmpEntriesArg
@ -2612,7 +2627,9 @@ dsa_pointer
dsa_segment_header dsa_segment_header
dsa_segment_index dsa_segment_index
dsa_segment_map dsa_segment_map
dshash_compare_function
dshash_hash dshash_hash
dshash_hash_function
dshash_parameters dshash_parameters
dshash_partition dshash_partition
dshash_table dshash_table