}
/*
- * we don't use uniquePairs here because we know that the pairs list is
- * already sorted and uniq'ed.
+ * we don't use hstoreUniquePairs here because we know that the pairs list
+ * is already sorted and uniq'ed.
*/
out = hstorePairs(out_pairs, out_count, bufsiz);
</row>
<row>
- <entry><literal>tcvn_to_utf8</literal></entry>
+ <entry><literal>windows_1258_to_utf8</literal></entry>
<entry><literal>WIN1258</literal></entry>
<entry><literal>UTF8</literal></entry>
</row>
</row>
<row>
- <entry><literal>utf8_to_tcvn</literal></entry>
+ <entry><literal>utf8_to_windows_1258</literal></entry>
<entry><literal>UTF8</literal></entry>
<entry><literal>WIN1258</literal></entry>
</row>
/*
* Choose where to put the index entries and update unionL and unionR
- * accordingly. Append the entries to either v_spl_left or
- * v_spl_right, and care about the counters.
+ * accordingly. Append the entries to either v->spl_left or
+ * v->spl_right, and care about the counters.
*/
if (my_choice_is_left(unionL, curl, unionR, curr))
#include "utils/typcache.h"
-#undef TOAST_DEBUG
-
/*
* The information at the start of the compressed toast data.
*/
if (!TransactionIdIsValid(xidVacLimit))
return true; /* this shouldn't happen anymore either */
if (TransactionIdFollowsOrEquals(nextXid, xidVacLimit))
- return true; /* past VacLimit, don't delay updating */
+ return true; /* past xidVacLimit, don't delay updating */
if (!SearchSysCacheExists1(DATABASEOID, ObjectIdGetDatum(oldestXidDB)))
return true; /* could happen, per comments above */
return false;
* in the user backend, so we need some additional bookkeeping.
*
* XactTopFullTransactionId stores the XID of our toplevel transaction, which
- * will be the same as TopTransactionState.fullTransactionId in an ordinary
- * backend; but in a parallel backend, which does not have the entire
+ * will be the same as TopTransactionStateData.fullTransactionId in an
+ * ordinary backend; but in a parallel backend, which does not have the entire
* transaction state, it will instead be copied from the backend that started
* the parallel operation.
*
/*
* These values do not change after startup, although the pointed-to pages
- * and xlblocks values certainly do. xlblock values are protected by
+ * and xlblocks values certainly do. xlblocks values are protected by
* WALBufMappingLock.
*/
char *pages; /* buffers for unwritten XLOG pages */
*/
#define UsableBytesInPage (XLOG_BLCKSZ - SizeOfXLogShortPHD)
-/* Convert min_wal_size_mb and max wal_size_mb to equivalent segment count */
+/* Convert min_wal_size_mb and max_wal_size_mb to equivalent segment count */
#define ConvertToXSegs(x, segsize) \
(x / ((segsize) / (1024 * 1024)))
int emode, bool fetching_ckpt);
static void CheckRecoveryConsistency(void);
static XLogRecord *ReadCheckpointRecord(XLogReaderState *xlogreader,
- XLogRecPtr RecPtr, int whichChkpti, bool report);
+ XLogRecPtr RecPtr, int whichChkpt, bool report);
static bool rescanLatestTimeLine(void);
static void WriteControlFile(void);
static void ReadControlFile(void);
else if (TimestampDifferenceExceeds(lastflush, now, WalWriterDelay))
{
/*
- * Flush the writes at least every WalWriteDelay ms. This is important
- * to bound the amount of time it takes for an asynchronous commit to
- * hit disk.
+ * Flush the writes at least every WalWriterDelay ms. This is
+ * important to bound the amount of time it takes for an asynchronous
+ * commit to hit disk.
*/
WriteRqst.Flush = WriteRqst.Write;
lastflush = now;
* Update the estimate of distance between checkpoints.
*
* The estimate is used to calculate the number of WAL segments to keep
- * preallocated, see XLOGFileSlop().
+ * preallocated, see XLOGfileslop().
*/
static void
UpdateCheckPointDistanceEstimate(uint64 nbytes)
values[0] = LSNGetDatum(stoppoint);
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
- tuplestore_donestoring(typstore);
+ tuplestore_donestoring(tupstore);
return (Datum) 0;
}
}
/*
- * Struct actually returned by XLogFakeRelcacheEntry, though the declared
+ * Struct actually returned by CreateFakeRelcacheEntry, though the declared
* return type is Relation.
*/
typedef struct
* DEAD or RECENTLY_DEAD (see HeapTupleSatisfiesVacuum).
* - freezeLimit is the Xid below which all Xids are replaced by
* FrozenTransactionId during vacuum.
- * - xidFullScanLimit (computed from table_freeze_age parameter)
+ * - xidFullScanLimit (computed from freeze_table_age parameter)
* represents a minimum Xid value; a table whose relfrozenxid is older than
* this will have a full-table vacuum applied to it, to freeze tuples across
* the whole table. Vacuuming a table younger than this value can use a
scratch.d.rowcompare_final.rctype = rcexpr->rctype;
ExprEvalPushStep(state, &scratch);
- /* adjust jump targetss */
+ /* adjust jump targets */
foreach(lc, adjust_jumps)
{
ExprEvalStep *as = &state->steps[lfirst_int(lc)];
* Initial States:
* -- the relation indicated is opened for scanning so that the
* "cursor" is positioned before the first qualifying tuple.
- * -- tidPtr is -1.
+ * -- tss_TidPtr is -1.
* ----------------------------------------------------------------
*/
static TupleTableSlot *
* scan keys, and opens the base and tid relations.
*
* Parameters:
- * node: TidNode node produced by the planner.
+ * node: TidScan node produced by the planner.
* estate: the execution state initialized in InitPlan.
* ----------------------------------------------------------------
*/
/*-------------------------------------------------------------------------
*
- * win32_crashdump.c
+ * crashdump.c
* Automatic crash dump creation for PostgreSQL on Windows
*
* The crashdump feature traps unhandled win32 exceptions produced by the
this_msg->m_nentries = 0;
}
}
- /* zero out TableStatus structs after use */
+ /* zero out PgStat_TableStatus structs after use */
MemSet(tsa->tsa_entries, 0,
tsa->tsa_used * sizeof(PgStat_TableStatus));
tsa->tsa_used = 0;
/*
* Worker thread to transfer data from the pipe to the current logfile.
*
- * We need this because on Windows, WaitforMultipleObjects does not work on
+ * We need this because on Windows, WaitForMultipleObjects does not work on
* unnamed pipes: it always reports "signaled", so the blocking ReadFile won't
* allow for SIGHUP; and select is for sockets only.
*/
/*
- * Check whether the TransactionOid 'xid' is in the pre-sorted array 'xip'.
+ * Check whether the TransactionId 'xid' is in the pre-sorted array 'xip'.
*/
static bool
TransactionIdInArray(TransactionId xid, TransactionId *xip, Size num)
parseCreateReplSlotOptions(cmd, &reserve_wal, &snapshot_action);
- /* setup state for XLogReadPage */
+ /* setup state for XLogRead */
sendTimeLineIsHistoric = false;
sendTimeLine = ThisTimeLineID;
}
/*
- * examine_operator_expression
+ * examine_opclause_expression
* Split expression into Var and Const parts.
*
* Attempts to match the arguments to either (Var op Const) or (Const op Var),
* LruInsert - put a file at the front of the Lru ring and open it
* ReleaseLruFile - Release an fd by closing the last entry in the Lru ring
* ReleaseLruFiles - Release fd(s) until we're under the max_safe_fds limit
- * AllocateVfd - grab a free (or new) file record (from VfdArray)
+ * AllocateVfd - grab a free (or new) file record (from VfdCache)
* FreeVfd - free a file record
*
* The Least Recently Used ring is a doubly linked list that begins and
}
/*
- * XactLockTableWaitErrorContextCb
+ * XactLockTableWaitErrorCb
* Error context callback for transaction lock waits.
*/
static void
* Finds the next whitespace-delimited word within the 'in' string.
* Returns a pointer to the first character of the word, and a pointer
* to the next byte after the last character in the word (in *end).
- * Character '*' at the end of word will not be threated as word
+ * Character '*' at the end of word will not be treated as word
* character if flags is not null.
*/
static char *
if (!dictExists)
{
/*
- * Dictionary can't work with current tpe of lexeme,
+ * Dictionary can't work with current type of lexeme,
* return to basic mode and redo all stored lexemes
*/
ld->curDictId = InvalidOid;
/*
* array_get_slice :
- * This routine takes an array and a range of indices (upperIndex and
+ * This routine takes an array and a range of indices (upperIndx and
* lowerIndx), creates a new array structure for the referred elements
* and returns a pointer to it.
*
* IPv4 addresses have a maximum of 32 bits compared to IPv6's 64 bits, so in
* IPv6 each part may be larger.
*
- * inet/cdir types compare using these sorting rules. If inequality is detected
+ * inet/cidr types compare using these sorting rules. If inequality is detected
* at any step, comparison is finished. If any rule is a tie, the algorithm
* drops through to the next to break it:
*
* error message by letting pg_verifymbstr check the string. But it's
* possible that the string is OK to us, and not OK to mbstowcs ---
* this suggests that the LC_CTYPE locale is different from the
- * database encoding. Give a generic error message if verifymbstr
+ * database encoding. Give a generic error message if pg_verifymbstr
* can't find anything wrong.
*/
pg_verifymbstr(from, fromlen, false); /* might not return */
/*
* If we can fit our keys onto our left sibling's page, consolidate. In
- * this case, we move our keys onto the other page rather than visca
- * versa, to avoid having to adjust ancestor keys.
+ * this case, we move our keys onto the other page rather than vice versa,
+ * to avoid having to adjust ancestor keys.
*/
np = FreePageBtreeFindLeftSibling(base, btp);
if (np != NULL && btp->hdr.nused + np->hdr.nused <= max)
/*
* Available WAL methods:
* - WalDirectoryMethod - write WAL to regular files in a standard pg_wal
- * - TarDirectoryMethod - write WAL to a tarfile corresponding to pg_wal
+ * - WalTarMethod - write WAL to a tarfile corresponding to pg_wal
* (only implements the methods required for pg_basebackup,
* not all those required for pg_receivewal)
*/
}
}
else
- fatal("internal error -- neither th nor fh specified in tarReadRaw()");
+ fatal("internal error -- neither th nor fh specified in _tarReadRaw()");
}
ctx->tarFHpos += res + used;
}
/*
- * Now that all the TableInfoData objects have been created for all the
+ * Now that all the TableDataInfo objects have been created for all the
* extensions, check their FK dependencies and register them to try and
* dump the data out in an order that they can be restored in.
*
}
}
-/* XLogreader callback function, to read a WAL page */
+/* XLogReader callback function, to read a WAL page */
static int
SimpleXLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr,
int reqLen, XLogRecPtr targetRecPtr, char *readBuf,
/* Use port in the private/dynamic port number range */
#define DEF_PGUPORT 50432
-/* Allocate for null byte */
-#define USER_NAME_SIZE 128
-
#define MAX_STRING 1024
#define QUERY_ALLOC 8192
* A cross-page update is the same as an insert, but also stores information
* about the old tuple.
*
- * Like in xlog_brin_update:
+ * Like in xl_brin_insert:
* Backup block 0: new page, block data includes the new BrinTuple.
* Backup block 1: revmap page
*
*
* In block 0's data portion, there is an xl_multi_insert_tuple struct,
* followed by the tuple data for each tuple. There is padding to align
- * each xl_multi_insert struct.
+ * each xl_multi_insert_tuple struct.
*/
typedef struct xl_heap_multi_insert
{
/*
* A tuple that has HEAP_XMAX_IS_MULTI and HEAP_XMAX_LOCK_ONLY but neither of
- * XMAX_EXCL_LOCK and XMAX_KEYSHR_LOCK must come from a tuple that was
+ * HEAP_XMAX_EXCL_LOCK and HEAP_XMAX_KEYSHR_LOCK must come from a tuple that was
* share-locked in 9.2 or earlier and then pg_upgrade'd.
*
* In 9.2 and prior, HEAP_XMAX_IS_MULTI was only set when there were multiple
* continue on the next page. xlp_rem_len is the number of bytes
* remaining from a previous page.
*
- * Note that xl_rem_len includes backup-block data; that is, it tracks
+ * Note that xlp_rem_len includes backup-block data; that is, it tracks
* xl_tot_len not xl_len in the initial header. Also note that the
* continuation data isn't necessarily aligned.
*/
extern void ExplainPrintJITSummary(ExplainState *es, QueryDesc *queryDesc);
extern void ExplainPrintJIT(ExplainState *es, int jit_flags,
- struct JitInstrumentation *jit_instr, int worker_i);
+ struct JitInstrumentation *jit_instr, int worker_num);
extern void ExplainQueryText(ExplainState *es, QueryDesc *queryDesc);
* is the start state number, which is easy enough to manage --- usually,
* in fact, we just need to set it to INITIAL when changing lexers. But to
* make that work at all, we must use re-entrant lexers, so that all the
- * relevant state is in the yyscanner_t attached to the PsqlScanState;
+ * relevant state is in the yyscan_t attached to the PsqlScanState;
* if we were using lexers with separate static state we would soon end up
* with dangling buffer pointers in one or the other. Also note that this
* is unlikely to work very nicely if the lexers aren't all built with the
#include <signal.h>
-#include "datatype/timestamp.h" /* for TimestampTZ */
+#include "datatype/timestamp.h" /* for TimestampTz */
#include "pgtime.h" /* for pg_time_t */
} WalRcvExecStatus;
/*
- * Return value for walrcv_query, returns the status of the execution and
+ * Return value for walrcv_exec, returns the status of the execution and
* tuples if any.
*/
typedef struct WalRcvExecResult
/*
* Flags for buffer descriptors
*
- * Note: TAG_VALID essentially means that there is a buffer hashtable
+ * Note: BM_TAG_VALID essentially means that there is a buffer hashtable
* entry associated with the buffer's tag.
*/
#define BM_LOCKED (1U << 22) /* buffer header is locked */
*
* If we're doing a Describe, we have to pass something
* back to the client, so set up a COMMAND_OK result,
- * instead of TUPLES_OK. Otherwise we can just ignore
- * this message.
+ * instead of PGRES_TUPLES_OK. Otherwise we can just
+ * ignore this message.
*/
if (conn->queryclass == PGQUERY_DESCRIBE)
{
const char *nullname = NULL;
/************************************************************
- * Prepare pointers for Tcl_SetVar2() below
+ * Prepare pointers for Tcl_SetVar2Ex() below
************************************************************/
if (arrayname == NULL)
{
step "s3_commit" { COMMIT; }
step "s3_vacuum" { VACUUM FREEZE tab_freeze; }
-# This permutation verfies that a previous bug
+# This permutation verifies that a previous bug
# https://postgr.es/m/E5711E62-8FDF-4DCA-A888-C200BF6B5742@amazon.com
# https://postgr.es/m/20171102112019.33wb7g5wp4zpjelu@alap3.anarazel.de
# is not reintroduced. We used to make wrong pruning / freezing
# isolation"[1].
#
# Here we test that serializable snapshot isolation can avoid the anomaly
-# without aborting any tranasctions, by instead causing s3 to be deferred
+# without aborting any transactions, by instead causing s3 to be deferred
# until a safe snapshot can be taken.
#
# [1] http://www.cs.umb.edu/~poneil/ROAnom.pdf
Functions
=========
-test_rls_hook_permissive(CmdType cmdtype, Relation relation)
+test_rls_hooks_permissive(CmdType cmdtype, Relation relation)
RETURNS List*
Returns a list of policies which should be added to any existing
policies on the relation, combined with OR.
-test_rls_hook_restrictive(CmdType cmdtype, Relation relation)
+test_rls_hooks_restrictive(CmdType cmdtype, Relation relation)
RETURNS List*
Returns a list of policies which should be added to any existing
/*-------------------------------------------------------------------------
*
- * test_thread_funcs.c
+ * thread_test.c
* libc thread test program
*
* Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
* in which Daylight Saving Time is never observed.
* 4. They might reference tzname[0] after setting to a time zone
* in which Standard Time is never observed.
- * 5. They might reference tm.TM_ZONE after calling offtime.
+ * 5. They might reference tm.tm_zone after calling offtime.
* What's best to do in the above cases is open to debate;
* for now, we just set things up so that in any of the five cases
* WILDABBR is used. Another possibility: initialize tzname[0] to the
<!-- Run ECPG and the Visual C++ compiler on the files. Don't bother with dependency check between the steps -->
<Exec WorkingDirectory="%(Pgc.RelativeDir)" Command="$(OUTDIR)ecpg\ecpg -I ../../include --regression $(ECPGPARAM) -o %(Pgc.Filename).c %(Pgc.Filename).pgc" />
- <Exec WorkingDirectorY="%(Pgc.RelativeDir)" Command="cl /nologo %(Pgc.FileName).c /TC /MD$(DEBUGLIB) /DENABLE_THREAD_SAFETY /DWIN32 /I. /I..\..\include /I..\..\..\libpq /I..\..\..\..\include /link /defaultlib:$(OUTDIR)libecpg\libecpg.lib /defaultlib:$(OUTDIR)libecpg_compat\libecpg_compat.lib /defaultlib:$(OUTDIR)libpgtypes\libpgtypes.lib" />
+ <Exec WorkingDirectory="%(Pgc.RelativeDir)" Command="cl /nologo %(Pgc.FileName).c /TC /MD$(DEBUGLIB) /DENABLE_THREAD_SAFETY /DWIN32 /I. /I..\..\include /I..\..\..\libpq /I..\..\..\..\include /link /defaultlib:$(OUTDIR)libecpg\libecpg.lib /defaultlib:$(OUTDIR)libecpg_compat\libecpg_compat.lib /defaultlib:$(OUTDIR)libpgtypes\libpgtypes.lib" />
</Target>
<!-- Clean up all output files -->