Discussion: http://postgr.es/m/CA+TgmoaA9=1RWKtBWpDaj+sF3Stgc8sHgf5z=KGtbjwPLQVDMA@mail.gmail.com
#define TH '0'
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 */
* Exported routines.
*---------------------------------------------------------*/
-void _PG_init(void);
+void _PG_init(void);
void
_PG_init(void)
/*
* Unless requested to summarize even a partial range, go away now if
- * we think the next range is partial. Caller would pass true when
- * it is typically run once bulk data loading is done
+ * we think the next range is partial. Caller would pass true when it
+ * is typically run once bulk data loading is done
* (brin_summarize_new_values), and false when it is typically the
* result of arbitrarily-scheduled maintenance command (vacuuming).
*/
Form_pg_attribute attr = TupleDescAttr(tupdesc, i);
pq_sendstring(&buf, NameStr(attr->attname));
- pq_sendint32(&buf, 0); /* table oid */
- pq_sendint16(&buf, 0); /* attnum */
+ pq_sendint32(&buf, 0); /* table oid */
+ pq_sendint16(&buf, 0); /* attnum */
pq_sendint32(&buf, (int) attr->atttypid);
pq_sendint16(&buf, attr->attlen);
pq_sendint32(&buf, attr->atttypmod);
- pq_sendint16(&buf, 0); /* format code */
+ pq_sendint16(&buf, 0); /* format code */
}
pq_endmessage(&buf);
else
{
/*
- * We used to attempt to go back to a secondary checkpoint
- * record here, but only when not in standby_mode. We now
- * just fail if we can't read the last checkpoint because
- * this allows us to simplify processing around checkpoints.
+ * We used to attempt to go back to a secondary checkpoint record
+ * here, but only when not in standby_mode. We now just fail if we
+ * can't read the last checkpoint because this allows us to
+ * simplify processing around checkpoints.
*/
ereport(PANIC,
(errmsg("could not locate a valid checkpoint record")));
(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;
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;
XLogReadDetermineTimeline(XLogReaderState *state, XLogRecPtr wantPage, uint32 wantLength)
{
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(wantLength <= XLOG_BLCKSZ);
if (or_expr_args != NIL)
{
- Expr *other_parts_constr;
+ Expr *other_parts_constr;
/*
* Combine the constraints obtained for non-default partitions
* useless repetition). Add the same now.
*/
other_parts_constr =
- makeBoolExpr(AND_EXPR,
- lappend(get_range_nulltest(key),
- list_length(or_expr_args) > 1
- ? makeBoolExpr(OR_EXPR, or_expr_args,
- -1)
- : linitial(or_expr_args)),
- -1);
+ makeBoolExpr(AND_EXPR,
+ lappend(get_range_nulltest(key),
+ list_length(or_expr_args) > 1
+ ? makeBoolExpr(OR_EXPR, or_expr_args,
+ -1)
+ : linitial(or_expr_args)),
+ -1);
/*
* Finally, the default partition contains everything *NOT*
* contained in the non-default partitions.
*/
result = list_make1(makeBoolExpr(NOT_EXPR,
- list_make1(other_parts_constr), -1));
+ list_make1(other_parts_constr), -1));
}
return result;
int
get_partition_for_tuple(Relation relation, Datum *values, bool *isnull)
{
- int bound_offset;
- int part_index = -1;
- PartitionKey key = RelationGetPartitionKey(relation);
+ int bound_offset;
+ int part_index = -1;
+ PartitionKey key = RelationGetPartitionKey(relation);
PartitionDesc partdesc = RelationGetPartitionDesc(relation);
/* Route as appropriate based on partitioning strategy. */
case PARTITION_STRATEGY_HASH:
{
PartitionBoundInfo boundinfo = partdesc->boundinfo;
- int greatest_modulus = get_greatest_modulus(boundinfo);
- uint64 rowHash = compute_hash_value(key, values, isnull);
+ int greatest_modulus = get_greatest_modulus(boundinfo);
+ uint64 rowHash = compute_hash_value(key, values, isnull);
part_index = boundinfo->indexes[rowHash % greatest_modulus];
}
/*
* No range includes NULL, so this will be accepted by the
- * default partition if there is one, and otherwise
- * rejected.
+ * default partition if there is one, and otherwise rejected.
*/
for (i = 0; i < key->partnatts; i++)
{
if (!range_partkey_has_null)
{
bound_offset = partition_bound_bsearch(key,
- partdesc->boundinfo,
+ partdesc->boundinfo,
values,
false,
&equal);
}
/*
- * part_index < 0 means we failed to find a partition of this parent.
- * Use the default partition, if there is one.
+ * part_index < 0 means we failed to find a partition of this parent. Use
+ * the default partition, if there is one.
*/
if (part_index < 0)
part_index = partdesc->boundinfo->default_index;
bool variadic_typbyval;
char variadic_typalign;
FmgrInfo partsupfunc[PARTITION_MAX_KEYS];
- } ColumnsHashData;
+ } ColumnsHashData;
Oid parentId;
int modulus;
int remainder;
PartitionDispatch *partition_dispatch_info;
int num_dispatch; /* Number of entries in the above array */
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;
TupleTableSlot *partition_tuple_slot;
TransitionCaptureState *transition_capture;
pq_sendbyte(&buf, format); /* overall format */
pq_sendint16(&buf, natts);
for (i = 0; i < natts; i++)
- pq_sendint16(&buf, format); /* per-column formats */
+ pq_sendint16(&buf, format); /* per-column formats */
pq_endmessage(&buf);
cstate->copy_dest = COPY_NEW_FE;
}
pq_sendbyte(&buf, format); /* overall format */
pq_sendint16(&buf, natts);
for (i = 0; i < natts; i++)
- pq_sendint16(&buf, format); /* per-column formats */
+ pq_sendint16(&buf, format); /* per-column formats */
pq_endmessage(&buf);
cstate->copy_dest = COPY_NEW_FE;
cstate->fe_msgbuf = makeStringInfo();
params->log_min_duration))
{
StringInfoData buf;
- char *msgfmt;
+ char *msgfmt;
TimestampDifference(starttime, endtime, &secs, &usecs);
parent = pd[0];
while (true)
{
- PartitionDesc partdesc;
+ PartitionDesc partdesc;
TupleTableSlot *myslot = parent->tupslot;
TupleConversionMap *map = parent->tupmap;
- int cur_index = -1;
+ int cur_index = -1;
rel = parent->reldesc;
partdesc = RelationGetPartitionDesc(rel);
if (mtstate->mt_partition_dispatch_info != NULL)
{
/*
- * For tuple routing among partitions, we need TupleDescs based
- * on the partition routing table.
+ * For tuple routing among partitions, we need TupleDescs based on
+ * the partition routing table.
*/
ResultRelInfo **resultRelInfos = mtstate->mt_partitions;
switch (*input)
{
case 'n':
+
/*
* The client does not support channel binding or has simply
* decided to not use it. In that case just let it go.
input++;
break;
case 'y':
+
/*
* The client supports channel binding and thinks that the server
* does not. In this case, the server must fail authentication if
input++;
break;
case 'p':
+
/*
* The client requires channel binding. Channel binding type
* follows, e.g., "p=tls-unique".
*/
{
- char *channel_binding_type;
+ char *channel_binding_type;
if (!state->ssl_in_use)
{
b64_message[b64_message_len] = '\0';
/*
- * Compare the value sent by the client with the value expected by
- * the server.
+ * Compare the value sent by the client with the value expected by the
+ * server.
*/
if (strcmp(channel_binding, b64_message) != 0)
ereport(ERROR,
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
* pam_passwd_conv_proc */
#endif /* USE_PAM */
pfree(sasl_mechs);
#ifdef USE_SSL
+
/*
* Get data for channel binding.
*/
*/
#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
char *filter;
LDAPMessage *search_message;
LDAPMessage *entry;
- char *attributes[] = { LDAP_NO_ATTRS, NULL };
+ char *attributes[] = {LDAP_NO_ATTRS, NULL};
char *dn;
char *c;
int count;
static void
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)
{
foreach(l2, initsubplan->setParam)
context.safe_param_ids = lcons_int(lfirst_int(l2),
- context.safe_param_ids);
+ context.safe_param_ids);
}
}
* workers can help project. But if there is something that is not
* 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))
{
/*
* It seems unlikely at present that there could be any other
* references to the subpath, but better safe than sorry.
*
- * Note that we don't change the parallel path's cost estimates; it might
- * be appropriate to do so, to reflect the fact that the bulk of the
- * target evaluation will happen in workers.
+ * Note that we don't change the parallel path's cost estimates; it
+ * might be appropriate to do so, to reflect the fact that the bulk of
+ * the target evaluation will happen in workers.
*/
if (IsA(path, GatherPath))
{
Relation relation)
{
PartitionDesc partdesc;
- PartitionKey partkey;
+ PartitionKey partkey;
Assert(relation->rd_rel->relkind == RELKIND_PARTITIONED_TABLE);
/*
* Did not find matching partition scheme. Create one copying relevant
- * information from the relcache. We need to copy the contents of the array
- * since the relcache entry may not survive after we have closed the
+ * information from the relcache. We need to copy the contents of the
+ * array since the relcache entry may not survive after we have closed the
* relation.
*/
part_scheme = (PartitionScheme) palloc0(sizeof(PartitionSchemeData));
continue;
/*
- * Otherwise, anything in a baserel or joinrel targetlist ought to be a
- * Var. Children of a partitioned table may have ConvertRowtypeExpr
- * translating whole-row Var of a child to that of the parent. Children
- * of an inherited table or subquery child rels can not directly
- * participate in a join, so other kinds of nodes here.
+ * Otherwise, anything in a baserel or joinrel targetlist ought to be
+ * a Var. Children of a partitioned table may have ConvertRowtypeExpr
+ * translating whole-row Var of a child to that of the parent.
+ * Children of an inherited table or subquery child rels can not
+ * directly participate in a join, so other kinds of nodes here.
*/
if (IsA(var, Var))
{
child_expr = (ConvertRowtypeExpr *) childvar;
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);
ndx = 0 - baserel->min_attr;
partnatts = joinrel->part_scheme->partnatts;
joinrel->partexprs = (List **) palloc0(sizeof(List *) * partnatts);
joinrel->nullable_partexprs =
- (List **) palloc0(sizeof(List *) *partnatts);
+ (List **) palloc0(sizeof(List *) * partnatts);
/*
* Construct partition keys for the join.
*
* 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 =
- * B.b can be regarded as partitioned on A.a or on B.b; they are equivalent.
+ * partitioned by either key expression. For example, A INNER JOIN B ON
+ * 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
- * partitioned in the same manner as the outer side, since the inner columns
- * are not retained.
+ * partitioned in the same manner as the outer side, since the inner
+ * columns are not retained.
*
* 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
* expressions from the OUTER side only. However, because all
* 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
- * future join levels anyway. Therefore, we track two sets of expressions:
- * those that authentically partition the relation (partexprs) and those
- * that partition the relation with the exception that extra nulls may be
- * present (nullable_partexprs). When the comparison operator is strict,
- * the latter is just as good as the former.
+ * future join levels anyway. Therefore, we track two sets of
+ * expressions: those that authentically partition the relation
+ * (partexprs) and those that partition the relation with the exception
+ * that extra nulls may be present (nullable_partexprs). When the
+ * comparison operator is strict, the latter is just as good as the
+ * former.
*/
for (cnt = 0; cnt < partnatts; cnt++)
{
{
int slotno;
bool found = false;
- static char result[BGW_MAXLEN];
+ static char result[BGW_MAXLEN];
LWLockAcquire(BackgroundWorkerLock, LW_SHARED);
/*
* If the client requested a newer protocol version or if the client
* requested any protocol options we didn't recognize, let them know
- * the newest minor protocol version we do support and the names of any
- * unrecognized options.
+ * the newest minor protocol version we do support and the names of
+ * any unrecognized options.
*/
if (PG_PROTOCOL_MINOR(proto) > PG_PROTOCOL_MINOR(PG_PROTOCOL_LATEST) ||
unrecognized_protocol_options != NIL)
*
* postgres: walsender <user> <host> <activity>
*
- * To achieve that, we pass "walsender" as username and username
- * as dbname to init_ps_display(). XXX: should add a new variant of
+ * To achieve that, we pass "walsender" as username and username as dbname
+ * to init_ps_display(). XXX: should add a new variant of
* init_ps_display() to avoid abusing the parameters like this.
*/
if (am_walsender)
/* Send CopyOutResponse message */
pq_beginmessage(&buf, 'H');
pq_sendbyte(&buf, 0); /* overall format */
- pq_sendint16(&buf, 0); /* natts */
+ pq_sendint16(&buf, 0); /* natts */
pq_endmessage(&buf);
if (ti->path == NULL)
pq_sendstring(&buf, "spcoid");
pq_sendint32(&buf, 0); /* table oid */
pq_sendint16(&buf, 0); /* attnum */
- pq_sendint32(&buf, OIDOID); /* type oid */
+ pq_sendint32(&buf, OIDOID); /* type oid */
pq_sendint16(&buf, 4); /* typlen */
pq_sendint32(&buf, 0); /* typmod */
pq_sendint16(&buf, 0); /* format code */
/* Send one datarow message */
pq_beginmessage(&buf, 'D');
- pq_sendint16(&buf, 3); /* number of columns */
+ pq_sendint16(&buf, 3); /* number of columns */
if (ti->path == NULL)
{
- pq_sendint32(&buf, -1); /* Length = -1 ==> NULL */
+ pq_sendint32(&buf, -1); /* Length = -1 ==> NULL */
pq_sendint32(&buf, -1);
}
else
if (ti->size >= 0)
send_int8_string(&buf, ti->size / 1024);
else
- pq_sendint32(&buf, -1); /* NULL */
+ pq_sendint32(&buf, -1); /* NULL */
pq_endmessage(&buf);
}
sizeof(ReorderBufferTXN));
buffer->tup_context = GenerationContextCreate(new_ctx,
- "Tuples",
- SLAB_LARGE_BLOCK_SIZE);
+ "Tuples",
+ SLAB_LARGE_BLOCK_SIZE);
hash_ctl.keysize = sizeof(TransactionId);
hash_ctl.entrysize = sizeof(ReorderBufferTXNByIdEnt);
char *buffer, bool skipFsync)
{
smgrsw[reln->smgr_which].smgr_extend(reln, forknum, blocknum,
- buffer, skipFsync);
+ buffer, skipFsync);
}
/*
char *buffer, bool skipFsync)
{
smgrsw[reln->smgr_which].smgr_write(reln, forknum, blocknum,
- buffer, skipFsync);
+ buffer, skipFsync);
}
BlockNumber nblocks)
{
smgrsw[reln->smgr_which].smgr_writeback(reln, forknum, blocknum,
- nblocks);
+ nblocks);
}
/*
/*
* First describe the parameters...
*/
- pq_beginmessage_reuse(&row_description_buf, 't'); /* parameter description
- * message type */
+ pq_beginmessage_reuse(&row_description_buf, 't'); /* parameter description
+ * message type */
pq_sendint16(&row_description_buf, psrc->num_params);
for (i = 0; i < psrc->num_params; i++)
/*
* Don't allow query cancel interrupts while reading input from the
* client, because we might lose sync in the FE/BE protocol. (Die
- * interrupts are OK, because we won't read any further messages from
- * the client in that case.)
+ * interrupts are OK, because we won't read any further messages from the
+ * client in that case.)
*/
if (QueryCancelPending && QueryCancelHoldoffCount != 0)
{
/*
- * Re-arm InterruptPending so that we process the cancel request
- * as soon as we're done reading the message.
+ * Re-arm InterruptPending so that we process the cancel request as
+ * soon as we're done reading the message.
*/
InterruptPending = true;
}
appendStringInfo(&str,
"!\t%ld kB max resident size\n",
#if defined(__darwin__)
- /* in bytes on macOS */
- r.ru_maxrss/1024
+ /* in bytes on macOS */
+ r.ru_maxrss / 1024
#else
- /* in kilobytes on most other platforms */
+ /* in kilobytes on most other platforms */
r.ru_maxrss
#endif
);
cmpspellaffix(const void *s1, const void *s2)
{
return strcmp((*(SPELL *const *) s1)->p.flag,
- (*(SPELL *const *) s2)->p.flag);
+ (*(SPELL *const *) s2)->p.flag);
}
static int
Int64GetDatumFast(key->time),
seed));
thash ^= DatumGetUInt64(hash_uint32_extended(key->zone,
- DatumGetInt64(seed)));
+ DatumGetInt64(seed)));
PG_RETURN_UINT64(thash);
}
int32 beid = PG_GETARG_INT32(0);
PgBackendStatus *beentry;
const char *activity;
- char *clipped_activity;
- text *ret;
+ char *clipped_activity;
+ text *ret;
if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL)
activity = "<backend information not available>";
#define Generation_BLOCKHDRSZ MAXALIGN(sizeof(GenerationBlock))
#define Generation_CHUNKHDRSZ sizeof(GenerationChunk)
-typedef struct GenerationBlock GenerationBlock; /* forward reference */
+typedef struct GenerationBlock GenerationBlock; /* forward reference */
typedef struct GenerationChunk GenerationChunk;
typedef void *GenerationPointer;
/* Generational context parameters */
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 */
-} GenerationContext;
+} GenerationContext;
/*
* GenerationBlock
static Size GenerationGetChunkSpace(MemoryContext context, void *pointer);
static bool GenerationIsEmpty(MemoryContext context);
static void GenerationStats(MemoryContext context, int level, bool print,
- MemoryContextCounters *totals);
+ MemoryContextCounters *totals);
#ifdef MEMORY_CONTEXT_CHECKING
static void GenerationCheck(MemoryContext context);
*/
MemoryContext
GenerationContextCreate(MemoryContext parent,
- const char *name,
- Size blockSize)
+ const char *name,
+ Size blockSize)
{
- GenerationContext *set;
+ GenerationContext *set;
/* Assert we padded GenerationChunk properly */
StaticAssertStmt(Generation_CHUNKHDRSZ == MAXALIGN(Generation_CHUNKHDRSZ),
/* Do the type-independent part of context creation */
set = (GenerationContext *) MemoryContextCreate(T_GenerationContext,
- sizeof(GenerationContext),
- &GenerationMethods,
- parent,
- name);
+ sizeof(GenerationContext),
+ &GenerationMethods,
+ parent,
+ name);
set->blockSize = blockSize;
static void
GenerationInit(MemoryContext context)
{
- GenerationContext *set = (GenerationContext *) context;
+ GenerationContext *set = (GenerationContext *) context;
set->block = NULL;
dlist_init(&set->blocks);
static void
GenerationReset(MemoryContext context)
{
- GenerationContext *set = (GenerationContext *) context;
+ GenerationContext *set = (GenerationContext *) context;
dlist_mutable_iter miter;
AssertArg(GenerationIsValid(set));
static void *
GenerationAlloc(MemoryContext context, Size size)
{
- GenerationContext *set = (GenerationContext *) context;
- GenerationBlock *block;
- GenerationChunk *chunk;
+ GenerationContext *set = (GenerationContext *) context;
+ GenerationBlock *block;
+ GenerationChunk *chunk;
Size chunk_size = MAXALIGN(size);
/* is it an over-sized chunk? if yes, allocate special block */
static void
GenerationFree(MemoryContext context, void *pointer)
{
- GenerationContext *set = (GenerationContext *) context;
- GenerationChunk *chunk = GenerationPointerGetChunk(pointer);
- GenerationBlock *block;
+ GenerationContext *set = (GenerationContext *) context;
+ GenerationChunk *chunk = GenerationPointerGetChunk(pointer);
+ GenerationBlock *block;
/* Allow access to private part of chunk header. */
VALGRIND_MAKE_MEM_DEFINED(chunk, GENERATIONCHUNK_PRIVATE_LEN);
if (chunk->requested_size < chunk->size)
if (!sentinel_ok(pointer, chunk->requested_size))
elog(WARNING, "detected write past chunk end in %s %p",
- ((MemoryContext)set)->name, chunk);
+ ((MemoryContext) set)->name, chunk);
#endif
#ifdef CLOBBER_FREED_MEMORY
static void *
GenerationRealloc(MemoryContext context, void *pointer, Size size)
{
- GenerationContext *set = (GenerationContext *) context;
- GenerationChunk *chunk = GenerationPointerGetChunk(pointer);
- GenerationPointer newPointer;
+ GenerationContext *set = (GenerationContext *) context;
+ GenerationChunk *chunk = GenerationPointerGetChunk(pointer);
+ GenerationPointer newPointer;
Size oldsize;
/* Allow access to private part of chunk header. */
if (chunk->requested_size < oldsize)
if (!sentinel_ok(pointer, chunk->requested_size))
elog(WARNING, "detected write past chunk end in %s %p",
- ((MemoryContext)set)->name, chunk);
+ ((MemoryContext) set)->name, chunk);
#endif
/*
static bool
GenerationIsEmpty(MemoryContext context)
{
- GenerationContext *set = (GenerationContext *) context;
+ GenerationContext *set = (GenerationContext *) context;
return dlist_is_empty(&set->blocks);
}
*/
static void
GenerationStats(MemoryContext context, int level, bool print,
- MemoryContextCounters *totals)
+ MemoryContextCounters *totals)
{
- GenerationContext *set = (GenerationContext *) context;
+ GenerationContext *set = (GenerationContext *) context;
Size nblocks = 0;
Size nchunks = 0;
Size nfreechunks = 0;
for (i = 0; i < level; i++)
fprintf(stderr, " ");
fprintf(stderr,
- "Generation: %s: %zu total in %zd blocks (%zd chunks); %zu free (%zd chunks); %zu used\n",
- ((MemoryContext)set)->name, totalspace, nblocks, nchunks, freespace,
+ "Generation: %s: %zu total in %zd blocks (%zd chunks); %zu free (%zd chunks); %zu used\n",
+ ((MemoryContext) set)->name, totalspace, nblocks, nchunks, freespace,
nfreechunks, totalspace - freespace);
}
static void
GenerationCheck(MemoryContext context)
{
- GenerationContext *gen = (GenerationContext *) context;
+ GenerationContext *gen = (GenerationContext *) context;
char *name = context->name;
dlist_iter iter;
}
}
-#endif /* MEMORY_CONTEXT_CHECKING */
+#endif /* MEMORY_CONTEXT_CHECKING */
case TSS_BUILDRUNS:
/*
- * Save the tuple into the unsorted array (there must be
- * space)
+ * Save the tuple into the unsorted array (there must be space)
*/
state->memtuples[state->memtupcount++] = *tuple;
int i;
/*
- * Nothing to do if we still fit in available memory and have array
- * slots, unless this is the final call during initial run generation.
+ * Nothing to do if we still fit in available memory and have array slots,
+ * unless this is the final call during initial run generation.
*/
if (state->memtupcount < state->memtupsize && !LACKMEM(state) &&
!alltuples)
/* internal vars */
static const char *progname;
-static int encodingid;
+static int encodingid;
static char *bki_file;
static char *desc_file;
static char *shdesc_file;
static FILE *popen_check(const char *command, const char *mode);
static void exit_nicely(void) pg_attribute_noreturn();
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 check_input(char *path);
static void write_version_file(const char *extrapath);
int c;
int option_index;
char *db_name;
- uint32 hi, lo;
+ uint32 hi,
+ lo;
progname = get_progname(argv[0]);
set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_basebackup"));
/* Replication commands */
extern bool CreateReplicationSlot(PGconn *conn, const char *slot_name,
- const char *plugin, bool is_temporary,
- bool is_physical, bool reserve_wal,
- bool slot_exists_ok);
+ const char *plugin, bool is_temporary,
+ bool is_physical, bool reserve_wal,
+ bool slot_exists_ok);
extern bool DropReplicationSlot(PGconn *conn, const char *slot_name);
extern bool RunIdentifySystem(PGconn *conn, char **sysid,
TimeLineID *starttli,
}
else
{
- char *partitioned_note;
+ char *partitioned_note;
if (*PQgetvalue(result, i, 2) == RELKIND_PARTITIONED_TABLE)
partitioned_note = ", PARTITIONED";
int itemIndex; /* current index in items[] */
HashScanPosItem items[MaxIndexTuplesPerPage]; /* MUST BE LAST */
-} HashScanPosData;
+} HashScanPosData;
#define HashScanPosIsPinned(scanpos) \
( \
/* For tuple routing */
extern int get_partition_for_tuple(Relation relation, Datum *values,
- bool *isnull);
+ bool *isnull);
#endif /* PARTITION_H */
BufferUsage *buffer_usage; /* points to bufusage area in DSM */
SharedExecutorInstrumentation *instrumentation; /* optional */
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 */
/* These two arrays have pcxt->nworkers_launched entries: */
shm_mq_handle **tqueue; /* tuple queues for worker output */
*/
typedef struct PartitionDispatchData
{
- Relation reldesc;
- PartitionKey key;
- List *keystate; /* list of ExprState */
- PartitionDesc partdesc;
+ Relation reldesc;
+ PartitionKey key;
+ List *keystate; /* list of ExprState */
+ PartitionDesc partdesc;
TupleTableSlot *tupslot;
TupleConversionMap *tupmap;
- int *indexes;
+ int *indexes;
} PartitionDispatchData;
typedef struct PartitionDispatchData *PartitionDispatch;
const char *txt, int len,
PsqlScanQuoteType quote);
extern void psqlscan_test_variable(PsqlScanState state,
- const char *txt, int len);
+ const char *txt, int len);
#endif /* PSQLSCAN_INT_H */
extern void dshash_release_lock(dshash_table *hash_table, void *entry);
/* 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);
/* Debugging support. */
* if necessary. Does not ensure a trailing null-byte exists.
*/
extern void appendBinaryStringInfoNT(StringInfo str,
- const char *data, int datalen);
+ const char *data, int datalen);
/*------------------------
* enlargeStringInfo
/* Name of SCRAM mechanisms per IANA */
#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 */
#define SCRAM_CHANNEL_BINDING_TLS_UNIQUE "tls-unique"
/* Routines dedicated to authentication */
extern void *pg_be_scram_init(const char *username, const char *shadow_pass,
- bool ssl_in_use, const char *tls_finished_message,
- size_t tls_finished_len);
+ bool ssl_in_use, const char *tls_finished_message,
+ size_t tls_finished_len);
extern int pg_be_scram_exchange(void *opaq, char *input, int inputlen,
char **output, int *outputlen, char **logdetail);
struct RelOptInfo **part_rels; /* Array of RelOptInfos of partitions,
* stored in the same order of bounds */
List **partexprs; /* Non-nullable partition key expressions. */
- List **nullable_partexprs; /* Nullable partition key expressions. */
+ List **nullable_partexprs; /* Nullable partition key expressions. */
} RelOptInfo;
/*
extern PGDLLIMPORT bool check_function_bodies;
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_messages;
/* generation.c */
extern MemoryContext GenerationContextCreate(MemoryContext parent,
- const char *name,
- Size blockSize);
+ const char *name,
+ Size blockSize);
/*
* Recommended default alloc parameters, suitable for "ordinary" contexts
if (INFORMIX_MODE(compat) && **scan_length == '.')
{
/* skip invalid characters */
- do {
+ do
+ {
(*scan_length)++;
} while (isdigit((unsigned char) **scan_length));
}
struct variable *var;
int desc_counter = 0;
int position = 0;
- const char *value;
+ const char *value;
bool std_strings = false;
/* Get standard_conforming_strings setting. */
free(cbind_input);
}
else if (state->ssl_in_use)
- appendPQExpBuffer(&buf, "c=eSws"); /* base64 of "y,," */
+ appendPQExpBuffer(&buf, "c=eSws"); /* base64 of "y,," */
else
- appendPQExpBuffer(&buf, "c=biws"); /* base64 of "n,," */
+ appendPQExpBuffer(&buf, "c=biws"); /* base64 of "n,," */
if (PQExpBufferDataBroken(buf))
goto oom_error;
*/
if (conn->ssl_in_use &&
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 &&
!selected_mechanism)
selected_mechanism = SCRAM_SHA256_NAME;
}
#ifdef USE_SSL
+
/*
* Get data for channel binding.
*/
#endif
/*
- * Initialize the SASL state information with all the information
- * gathered during the initial exchange.
+ * Initialize the SASL state information with all the information gathered
+ * during the initial exchange.
*
* Note: Only tls-unique is supported for the moment.
*/
/* Prototypes for functions in fe-auth-scram.c */
extern void *pg_fe_scram_init(const char *username,
- const char *password,
- bool ssl_in_use,
- const char *sasl_mechanism,
- char *tls_finished_message,
- size_t tls_finished_len);
+ const char *password,
+ bool ssl_in_use,
+ const char *sasl_mechanism,
+ char *tls_finished_message,
+ size_t tls_finished_len);
extern void pg_fe_scram_free(void *opaq);
extern void pg_fe_scram_exchange(void *opaq, char *input, int inputlen,
char **output, int *outputlen,
if (IsA(tle_expr, Const))
break;
/* Otherwise, it had better be a Param or an outer Var */
- Assert(IsA(tle_expr, Param) || (IsA(tle_expr, Var) &&
- ((Var *) tle_expr)->varno == OUTER_VAR));
+ Assert(IsA(tle_expr, Param) ||(IsA(tle_expr, Var) &&
+ ((Var *) tle_expr)->varno == OUTER_VAR));
/* Descend to the child node */
plan = plan->lefttree;
}
#ifndef HAVE_STRERROR_R
static char *strerror_p1;
static char *strerror_p2;
-static int strerror_threadsafe = 0;
+static int strerror_threadsafe = 0;
#endif
#if !defined(WIN32) && !defined(HAVE_GETPWUID_R)
static struct passwd *passwd_p1;
static struct passwd *passwd_p2;
-static int getpwuid_threadsafe = 0;
+static int getpwuid_threadsafe = 0;
#endif
#if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME_R)
static struct hostent *hostent_p1;
static struct hostent *hostent_p2;
static char myhostname[MAXHOSTNAMELEN];
-static int gethostbyname_threadsafe = 0;
+static int gethostbyname_threadsafe = 0;
#endif
-static int platform_is_threadsafe = 1;
+static int platform_is_threadsafe = 1;
int
main(int argc, char *argv[])
AfterTriggerShared
AfterTriggerSharedData
AfterTriggersData
+AfterTriggersQueryData
+AfterTriggersTableData
+AfterTriggersTransData
Agg
AggClauseCosts
AggInfo
ArrayParseState
ArrayRef
ArrayRefState
-ArrayRemapInfo
ArrayType
AsyncQueueControl
AsyncQueueEntry
AutoVacuumShmemStruct
AutoVacuumWorkItem
AutoVacuumWorkItemType
-AutovacWorkItems
AuxProcType
BF_ctx
BF_key
BulkInsertState
CACHESIGN
CAC_state
+CCFastEqualFN
+CCHashFN
CEOUC_WAIT_MODE
CFuncHashTabEntry
CHAR
CatCacheHeader
CatalogId
CatalogIndexState
-CCHashFN
-CCFastEqualFN
ChangeVarNodes_context
CheckPoint
CheckPointStmt
ColumnDef
ColumnIOData
ColumnRef
+ColumnsHashData
CombinationGenerator
ComboCidEntry
ComboCidEntryData
File
FileFdwExecutionState
FileFdwPlanState
-FileName
FileNameMap
FindSplitData
+FixedParallelExecutorState
FixedParallelState
FixedParamState
FlagMode
GatherPath
GatherState
Gene
+GenerationBlock
+GenerationChunk
+GenerationContext
+GenerationPointer
GenericCosts
GenericXLogState
GeqoPrivateData
HashPath
HashScanOpaque
HashScanOpaqueData
+HashScanPosData
HashScanPosItem
HashSkewBucket
HashState
Instrumentation
Int128AggState
Int8TransTypeData
+IntRBTreeNode
InternalDefaultACL
InternalGrant
Interval
IntoClause
InvalidationChunk
InvalidationListHeader
-InvertedWalkNextStep
IpcMemoryId
IpcMemoryKey
IpcSemaphoreId
MergeJoinState
MergePath
MergeScanSelCache
+MetaCommand
MinMaxAggInfo
MinMaxAggPath
MinMaxExpr
PLpgSQL_variable
PLwdatum
PLword
+PLyArrayToOb
PLyCursorObject
PLyDatumToOb
PLyDatumToObFunc
PLyExceptionEntry
PLyExecutionContext
+PLyObToArray
PLyObToDatum
PLyObToDatumFunc
+PLyObToDomain
+PLyObToScalar
+PLyObToTransform
PLyObToTuple
PLyObject_AsString_t
PLyPlanObject
PLyResultObject
PLySRFState
PLySavedArgs
+PLyScalarToOb
PLySubtransactionData
PLySubtransactionObject
+PLyTransformToOb
PLyTupleToOb
-PLyTypeInfo
-PLyTypeInput
-PLyTypeOutput
PLyUnicode_FromStringAndSize_t
PMINIDUMP_CALLBACK_INFORMATION
PMINIDUMP_EXCEPTION_INFORMATION
PartitionDispatch
PartitionDispatchData
PartitionElem
-PartitionKey
PartitionHashBound
+PartitionKey
PartitionListValue
PartitionRangeBound
PartitionRangeDatum
PartitionRangeDatumKind
+PartitionScheme
PartitionSpec
PartitionedChildRelInfo
PasswordType
PopulateArrayContext
PopulateArrayState
PopulateRecordCache
+PopulateRecordsetCache
PopulateRecordsetState
Port
Portal
RangeFunction
RangeIOData
RangeQueryClause
-RangeRemapInfo
RangeSubselect
RangeTableFunc
RangeTableFuncCol
RangeVarGetRelidCallback
RawColumnDefault
RawStmt
+ReInitializeDSMForeignScan_function
ReScanForeignScan_function
ReadBufPtrType
ReadBufferMode
RecordCacheEntry
RecordCompareData
RecordIOData
-RecordRemapInfo
-RecordTypmodMap
RecoveryTargetAction
RecoveryTargetType
RectBox
ReorderBufferTupleCidKey
ReorderTuple
RepOriginId
+ReparameterizeForeignPathByChild_function
ReplaceVarsFromTargetList_context
ReplaceVarsNoMatchOption
ReplicaIdentityStmt
SharedInvalSmgrMsg
SharedInvalSnapshotMsg
SharedInvalidationMessage
-SharedRecordTableKey
SharedRecordTableEntry
+SharedRecordTableKey
SharedRecordTypmodRegistry
+SharedSortInfo
SharedTypmodTableEntry
ShellTypeInfo
ShippableCacheEntry
TupleHashIterator
TupleHashTable
TupleQueueReader
-TupleRemapClass
-TupleRemapInfo
TupleTableSlot
+TuplesortInstrumentation
+TuplesortMethod
+TuplesortSpaceType
Tuplesortstate
Tuplestorestate
TwoPhaseCallback
UCharIterator
UCollator
UConverter
-UEnumeration
UErrorCode
UINT
ULARGE_INTEGER
VacAttrStats
VacAttrStatsP
VacuumParams
+VacuumRelation
VacuumStmt
Value
ValuesScan
binaryheap
binaryheap_comparator
bitmapword
+bits16
bits32
bits8
bool
check_object_relabel_type
check_password_hook_type
check_ungrouped_columns_context
-chkpass
chr
clock_t
cmpEntriesArg
dsa_segment_header
dsa_segment_index
dsa_segment_map
+dshash_compare_function
dshash_hash
+dshash_hash_function
dshash_parameters
dshash_partition
dshash_table