static SerializedRanges *brin_range_serialize(Ranges *range);
-static Ranges *brin_range_deserialize(int maxvalues, SerializedRanges *range);
+static Ranges *brin_range_deserialize(int maxvalues,
+ SerializedRanges *serialized);
/*
* 'relopt_struct_size'.
*/
void
-init_local_reloptions(local_relopts *opts, Size relopt_struct_size)
+init_local_reloptions(local_relopts *relopts, Size relopt_struct_size)
{
- opts->options = NIL;
- opts->validators = NIL;
- opts->relopt_struct_size = relopt_struct_size;
+ relopts->options = NIL;
+ relopts->validators = NIL;
+ relopts->relopt_struct_size = relopt_struct_size;
}
/*
* build_local_reloptions().
*/
void
-register_reloptions_validator(local_relopts *opts, relopts_validator validator)
+register_reloptions_validator(local_relopts *relopts, relopts_validator validator)
{
- opts->validators = lappend(opts->validators, validator);
+ relopts->validators = lappend(relopts->validators, validator);
}
/*
* The number of items is returned in *ndecoded.
*/
ItemPointer
-ginPostingListDecode(GinPostingList *plist, int *ndecoded)
+ginPostingListDecode(GinPostingList *plist, int *ndecoded_out)
{
return ginPostingListDecodeAllSegments(plist,
SizeOfGinPostingList(plist),
- ndecoded);
+ ndecoded_out);
}
/*
BlockNumber parentblk, OffsetNumber downlinkoffnum);
static Buffer gistBufferingFindCorrectParent(GISTBuildState *buildstate,
BlockNumber childblkno, int level,
- BlockNumber *parentblk,
+ BlockNumber *parentblkno,
OffsetNumber *downlinkoffnum);
static void gistProcessEmptyingQueue(GISTBuildState *buildstate);
static void gistEmptyAllBuffers(GISTBuildState *buildstate);
static void gistInitParentMap(GISTBuildState *buildstate);
static void gistMemorizeParent(GISTBuildState *buildstate, BlockNumber child,
BlockNumber parent);
-static void gistMemorizeAllDownlinks(GISTBuildState *buildstate, Buffer parent);
+static void gistMemorizeAllDownlinks(GISTBuildState *buildstate,
+ Buffer parentbuf);
static BlockNumber gistGetParent(GISTBuildState *buildstate, BlockNumber child);
static void gistUnloadNodeBuffer(GISTBuildBuffers *gfbb,
GISTNodeBuffer *nodeBuffer);
static void gistPlaceItupToPage(GISTNodeBufferPage *pageBuffer,
- IndexTuple item);
+ IndexTuple itup);
static void gistGetItupFromPage(GISTNodeBufferPage *pageBuffer,
- IndexTuple *item);
+ IndexTuple *itup);
static long gistBuffersGetFreeBlock(GISTBuildBuffers *gfbb);
static void gistBuffersReleaseBlock(GISTBuildBuffers *gfbb, long blocknum);
static void gistvacuum_delete_empty_pages(IndexVacuumInfo *info,
GistVacState *vstate);
static bool gistdeletepage(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
- Buffer buffer, OffsetNumber downlink,
+ Buffer parentBuffer, OffsetNumber downlink,
Buffer leafBuffer);
/*
};
static void writeFragment(PageData *pageData, OffsetNumber offset,
- OffsetNumber len, const char *data);
+ OffsetNumber length, const char *data);
static void computeRegionDelta(PageData *pageData,
const char *curpage, const char *targetpage,
int targetStart, int targetEnd,
static void AtSubStart_ResourceOwner(void);
static void ShowTransactionState(const char *str);
-static void ShowTransactionStateRec(const char *str, TransactionState state);
+static void ShowTransactionStateRec(const char *str, TransactionState s);
static const char *BlockStateAsString(TBlockState blockState);
static const char *TransStateAsString(TransState state);
static int LocalSetXLogInsertAllowed(void);
static void CreateEndOfRecoveryRecord(void);
static XLogRecPtr CreateOverwriteContrecordRecord(XLogRecPtr aborted_lsn,
- XLogRecPtr missingContrecPtr,
+ XLogRecPtr pagePtr,
TimeLineID newTLI);
static void CheckPointGuts(XLogRecPtr checkPointRedo, int flags);
static void KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo);
* the unused space to be left out from the WAL record, making it smaller.
*/
XLogRecPtr
-log_newpage(RelFileLocator *rlocator, ForkNumber forkNum, BlockNumber blkno,
+log_newpage(RelFileLocator *rlocator, ForkNumber forknum, BlockNumber blkno,
Page page, bool page_std)
{
int flags;
flags |= REGBUF_STANDARD;
XLogBeginInsert();
- XLogRegisterBlock(0, rlocator, forkNum, blkno, page, flags);
+ XLogRegisterBlock(0, rlocator, forknum, blkno, page, flags);
recptr = XLogInsert(RM_XLOG_ID, XLOG_FPI);
/*
* because we can write multiple pages in a single WAL record.
*/
void
-log_newpages(RelFileLocator *rlocator, ForkNumber forkNum, int num_pages,
+log_newpages(RelFileLocator *rlocator, ForkNumber forknum, int num_pages,
BlockNumber *blknos, Page *pages, bool page_std)
{
int flags;
nbatch = 0;
while (nbatch < XLR_MAX_BLOCK_ID && i < num_pages)
{
- XLogRegisterBlock(nbatch, rlocator, forkNum, blknos[i], pages[i], flags);
+ XLogRegisterBlock(nbatch, rlocator, forknum, blknos[i], pages[i], flags);
i++;
nbatch++;
}
{
Page page = BufferGetPage(buffer);
RelFileLocator rlocator;
- ForkNumber forkNum;
+ ForkNumber forknum;
BlockNumber blkno;
/* Shared buffers should be modified in a critical section. */
Assert(CritSectionCount > 0);
- BufferGetTag(buffer, &rlocator, &forkNum, &blkno);
+ BufferGetTag(buffer, &rlocator, &forknum, &blkno);
- return log_newpage(&rlocator, forkNum, blkno, page, page_std);
+ return log_newpage(&rlocator, forknum, blkno, page, page_std);
}
/*
* cause a deadlock through some other means.
*/
void
-log_newpage_range(Relation rel, ForkNumber forkNum,
+log_newpage_range(Relation rel, ForkNumber forknum,
BlockNumber startblk, BlockNumber endblk,
bool page_std)
{
nbufs = 0;
while (nbufs < XLR_MAX_BLOCK_ID && blkno < endblk)
{
- Buffer buf = ReadBufferExtended(rel, forkNum, blkno,
+ Buffer buf = ReadBufferExtended(rel, forknum, blkno,
RBM_NORMAL, NULL);
LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);
static int ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr,
int reqLen);
static void XLogReaderInvalReadState(XLogReaderState *state);
-static XLogPageReadResult XLogDecodeNextRecord(XLogReaderState *state, bool non_blocking);
+static XLogPageReadResult XLogDecodeNextRecord(XLogReaderState *state, bool nonblocking);
static bool ValidXLogRecordHeader(XLogReaderState *state, XLogRecPtr RecPtr,
XLogRecPtr PrevRecPtr, XLogRecord *record, bool randAccess);
static bool ValidXLogRecord(XLogReaderState *state, XLogRecord *record,
bool binary_upgrade_record_init_privs = false;
static void ExecGrantStmt_oids(InternalGrant *istmt);
-static void ExecGrant_Relation(InternalGrant *grantStmt);
-static void ExecGrant_Database(InternalGrant *grantStmt);
-static void ExecGrant_Fdw(InternalGrant *grantStmt);
-static void ExecGrant_ForeignServer(InternalGrant *grantStmt);
-static void ExecGrant_Function(InternalGrant *grantStmt);
-static void ExecGrant_Language(InternalGrant *grantStmt);
-static void ExecGrant_Largeobject(InternalGrant *grantStmt);
-static void ExecGrant_Namespace(InternalGrant *grantStmt);
-static void ExecGrant_Tablespace(InternalGrant *grantStmt);
-static void ExecGrant_Type(InternalGrant *grantStmt);
-static void ExecGrant_Parameter(InternalGrant *grantStmt);
+static void ExecGrant_Relation(InternalGrant *istmt);
+static void ExecGrant_Database(InternalGrant *istmt);
+static void ExecGrant_Fdw(InternalGrant *istmt);
+static void ExecGrant_ForeignServer(InternalGrant *istmt);
+static void ExecGrant_Function(InternalGrant *istmt);
+static void ExecGrant_Language(InternalGrant *istmt);
+static void ExecGrant_Largeobject(InternalGrant *istmt);
+static void ExecGrant_Namespace(InternalGrant *istmt);
+static void ExecGrant_Tablespace(InternalGrant *istmt);
+static void ExecGrant_Type(InternalGrant *istmt);
+static void ExecGrant_Parameter(InternalGrant *istmt);
static void SetDefaultACLsInSchemas(InternalDefaultACL *iacls, List *nspnames);
static void SetDefaultACL(InternalDefaultACL *iacls);
* database's encoding.
*/
Oid
-get_collation_oid(List *name, bool missing_ok)
+get_collation_oid(List *collname, bool missing_ok)
{
char *schemaname;
char *collation_name;
ListCell *l;
/* deconstruct the name list */
- DeconstructQualifiedName(name, &schemaname, &collation_name);
+ DeconstructQualifiedName(collname, &schemaname, &collation_name);
if (schemaname)
{
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("collation \"%s\" for encoding \"%s\" does not exist",
- NameListToString(name), GetDatabaseEncodingName())));
+ NameListToString(collname), GetDatabaseEncodingName())));
return InvalidOid;
}
* get_conversion_oid - find a conversion by possibly qualified name
*/
Oid
-get_conversion_oid(List *name, bool missing_ok)
+get_conversion_oid(List *conname, bool missing_ok)
{
char *schemaname;
char *conversion_name;
ListCell *l;
/* deconstruct the name list */
- DeconstructQualifiedName(name, &schemaname, &conversion_name);
+ DeconstructQualifiedName(conname, &schemaname, &conversion_name);
if (schemaname)
{
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("conversion \"%s\" does not exist",
- NameListToString(name))));
+ NameListToString(conname))));
return conoid;
}
static void remove_dbtablespaces(Oid db_id);
static bool check_db_file_conflict(Oid db_id);
static int errdetail_busy_db(int notherbackends, int npreparedxacts);
-static void CreateDatabaseUsingWalLog(Oid src_dboid, Oid dboid, Oid src_tsid,
+static void CreateDatabaseUsingWalLog(Oid src_dboid, Oid dst_dboid, Oid src_tsid,
Oid dst_tsid);
-static List *ScanSourceDatabasePgClass(Oid srctbid, Oid srcdbid, char *srcpath);
+static List *ScanSourceDatabasePgClass(Oid tbid, Oid dbid, char *srcpath);
static List *ScanSourceDatabasePgClassPage(Page page, Buffer buf, Oid tbid,
Oid dbid, char *srcpath,
List *rlocatorlist, Snapshot snapshot);
char *srcpath);
static void CreateDirAndVersionFile(char *dbpath, Oid dbid, Oid tsid,
bool isRedo);
-static void CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dboid, Oid src_tsid,
- Oid dst_tsid);
+static void CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dst_dboid,
+ Oid src_tsid, Oid dst_tsid);
static void recovery_create_dbdir(char *path, bool only_tblspc);
/*
Datum *values, bool *isnull,
EState *estate, bool newIndex,
CEOUC_WAIT_MODE waitMode,
- bool errorOK,
+ bool violationOK,
ItemPointer conflictTid);
static bool index_recheck_constraint(Relation index, Oid *constr_procs,
/* Helper functions that run in the parallel leader. */
static char *ExecSerializePlan(Plan *plan, EState *estate);
-static bool ExecParallelEstimate(PlanState *node,
+static bool ExecParallelEstimate(PlanState *planstate,
ExecParallelEstimateContext *e);
-static bool ExecParallelInitializeDSM(PlanState *node,
+static bool ExecParallelInitializeDSM(PlanState *planstate,
ExecParallelInitializeDSMContext *d);
static shm_mq_handle **ExecParallelSetupTupleQueues(ParallelContext *pcxt,
bool reinitialize);
TupleTableSlot *slot,
int currentSet);
static void finalize_aggregates(AggState *aggstate,
- AggStatePerAgg peragg,
+ AggStatePerAgg peraggs,
AggStatePerGroup pergroup);
static TupleTableSlot *project_aggregates(AggState *aggstate);
static void find_cols(AggState *aggstate, Bitmapset **aggregated,
static void hashagg_recompile_expressions(AggState *aggstate, bool minslot,
bool nullcheck);
static long hash_choose_num_buckets(double hashentrysize,
- long estimated_nbuckets,
- Size memory);
+ long ngroups, Size memory);
static int hash_choose_num_partitions(double input_groups,
double hashentrysize,
int used_bits,
- int *log2_npartittions);
+ int *log2_npartitions);
static void initialize_hash_entry(AggState *aggstate,
TupleHashTable hashtable,
TupleHashEntry entry);
int64 input_tuples, double input_card,
int used_bits);
static MinimalTuple hashagg_batch_read(HashAggBatch *batch, uint32 *hashp);
-static void hashagg_spill_init(HashAggSpill *spill, LogicalTapeSet *lts,
+static void hashagg_spill_init(HashAggSpill *spill, LogicalTapeSet *tapeset,
int used_bits, double input_groups,
double hashentrysize);
static Size hashagg_spill_tuple(AggState *aggstate, HashAggSpill *spill,
- TupleTableSlot *slot, uint32 hash);
+ TupleTableSlot *inputslot, uint32 hash);
static void hashagg_spill_finish(AggState *aggstate, HashAggSpill *spill,
int setno);
static Datum GetAggInitVal(Datum textInitVal, Oid transtype);
dsa_pointer *shared);
static void MultiExecPrivateHash(HashState *node);
static void MultiExecParallelHash(HashState *node);
-static inline HashJoinTuple ExecParallelHashFirstTuple(HashJoinTable table,
+static inline HashJoinTuple ExecParallelHashFirstTuple(HashJoinTable hashtable,
int bucketno);
-static inline HashJoinTuple ExecParallelHashNextTuple(HashJoinTable table,
+static inline HashJoinTuple ExecParallelHashNextTuple(HashJoinTable hashtable,
HashJoinTuple tuple);
static inline void ExecParallelHashPushTuple(dsa_pointer_atomic *head,
HashJoinTuple tuple,
static void ExecParallelHashEnsureBatchAccessors(HashJoinTable hashtable);
static void ExecParallelHashRepartitionFirst(HashJoinTable hashtable);
static void ExecParallelHashRepartitionRest(HashJoinTable hashtable);
-static HashMemoryChunk ExecParallelHashPopChunkQueue(HashJoinTable table,
+static HashMemoryChunk ExecParallelHashPopChunkQueue(HashJoinTable hashtable,
dsa_pointer *shared);
static bool ExecParallelHashTuplePrealloc(HashJoinTable hashtable,
int batchno,
TupleTableSlot *tupleSlot);
static bool ExecHashJoinNewBatch(HashJoinState *hjstate);
static bool ExecParallelHashJoinNewBatch(HashJoinState *hjstate);
-static void ExecParallelHashJoinPartitionOuter(HashJoinState *node);
+static void ExecParallelHashJoinPartitionOuter(HashJoinState *hjstate);
/* ----------------------------------------------------------------
* ----------------------------------------------------------------
*/
void
-ExecHashJoinReInitializeDSM(HashJoinState *state, ParallelContext *cxt)
+ExecHashJoinReInitializeDSM(HashJoinState *state, ParallelContext *pcxt)
{
int plan_node_id = state->js.ps.plan->plan_node_id;
ParallelHashJoinState *pstate =
- shm_toc_lookup(cxt->toc, plan_node_id, false);
+ shm_toc_lookup(pcxt->toc, plan_node_id, false);
/*
* It would be possible to reuse the shared hash table in single-batch
static uint32 MemoizeHash_hash(struct memoize_hash *tb,
const MemoizeKey *key);
static bool MemoizeHash_equal(struct memoize_hash *tb,
- const MemoizeKey *params1,
- const MemoizeKey *params2);
+ const MemoizeKey *key1,
+ const MemoizeKey *key2);
#define SH_PREFIX memoize
#define SH_ELEMENT_TYPE MemoizeEntry
static int optimal_k(uint64 bitset_bits, int64 total_elems);
static void k_hashes(bloom_filter *filter, uint32 *hashes, unsigned char *elem,
size_t len);
-static inline uint32 mod_m(uint32 a, uint64 m);
+static inline uint32 mod_m(uint32 val, uint64 m);
/*
* Create Bloom filter in caller's memory context. We aim for a false positive
/* common function to decode tuples */
-static void DecodeXLogTuple(char *data, Size len, ReorderBufferTupleBuf *tup);
+static void DecodeXLogTuple(char *data, Size len, ReorderBufferTupleBuf *tuple);
/* helper functions for decoding transactions */
static inline bool FilterPrepare(LogicalDecodingContext *ctx,
TransactionId xid, const char *gid);
static bool DecodeTXNNeedSkip(LogicalDecodingContext *ctx,
- XLogRecordBuffer *buf, Oid dbId,
+ XLogRecordBuffer *buf, Oid txn_dbid,
RepOriginId origin_id);
/*
* Serialize and deserialize changes for a toplevel transaction.
*/
static void stream_cleanup_files(Oid subid, TransactionId xid);
-static void stream_open_file(Oid subid, TransactionId xid, bool first);
+static void stream_open_file(Oid subid, TransactionId xid,
+ bool first_segment);
static void stream_write_change(char action, StringInfo s);
static void stream_close_file(void);
static void pgoutput_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
static void pgoutput_change(LogicalDecodingContext *ctx,
- ReorderBufferTXN *txn, Relation rel,
+ ReorderBufferTXN *txn, Relation relation,
ReorderBufferChange *change);
static void pgoutput_truncate(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, int nrelations, Relation relations[],
/* Map used to remember which relation schemas we sent. */
static HTAB *RelationSyncCache = NULL;
-static void init_rel_sync_cache(MemoryContext decoding_context);
+static void init_rel_sync_cache(MemoryContext cachectx);
static void cleanup_rel_sync_cache(TransactionId xid, bool is_commit);
static RelationSyncEntry *get_rel_sync_entry(PGOutputData *data,
Relation relation);
/* internal persistency functions */
static void RestoreSlotFromDisk(const char *name);
static void CreateSlotOnDisk(ReplicationSlot *slot);
-static void SaveSlotToPath(ReplicationSlot *slot, const char *path, int elevel);
+static void SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel);
/*
* Report shared-memory space needed by ReplicationSlotsShmemInit.
)
-static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence,
+static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence,
ForkNumber forkNum, BlockNumber blockNum,
ReadBufferMode mode, BufferAccessStrategy strategy,
bool *hit);
static void AtProcExit_Buffers(int code, Datum arg);
static void CheckForBufferLeaks(void);
static int rlocator_comparator(const void *p1, const void *p2);
-static inline int buffertag_comparator(const BufferTag *a, const BufferTag *b);
+static inline int buffertag_comparator(const BufferTag *ba, const BufferTag *bb);
static inline int ckpt_buforder_comparator(const CkptSortItem *a, const CkptSortItem *b);
static int ts_ckpt_progress_comparator(Datum a, Datum b, void *arg);
static void BufFileLoadBuffer(BufFile *file);
static void BufFileDumpBuffer(BufFile *file);
static void BufFileFlush(BufFile *file);
-static File MakeNewFileSetSegment(BufFile *file, int segment);
+static File MakeNewFileSetSegment(BufFile *buffile, int segment);
/*
* Create BufFile and perform the common initialization.
static BlockNumber fsm_search(Relation rel, uint8 min_cat);
static uint8 fsm_vacuum_page(Relation rel, FSMAddress addr,
BlockNumber start, BlockNumber end,
- bool *eof);
+ bool *eof_p);
/******** Public API ********/
* Find an existing mapping for a shared memory segment, if there is one.
*/
dsm_segment *
-dsm_find_mapping(dsm_handle h)
+dsm_find_mapping(dsm_handle handle)
{
dlist_iter iter;
dsm_segment *seg;
dlist_foreach(iter, &dsm_segment_list)
{
seg = dlist_container(dsm_segment, node, iter.cur);
- if (seg->handle == h)
+ if (seg->handle == handle)
return seg;
}
static void KnownAssignedXidsRemove(TransactionId xid);
static void KnownAssignedXidsRemoveTree(TransactionId xid, int nsubxids,
TransactionId *subxids);
-static void KnownAssignedXidsRemovePreceding(TransactionId xid);
+static void KnownAssignedXidsRemovePreceding(TransactionId removeXid);
static int KnownAssignedXidsGet(TransactionId *xarray, TransactionId xmax);
static int KnownAssignedXidsGetAndSetXmin(TransactionId *xarray,
TransactionId *xmin,
* This is meant as debug support only.
*/
bool
-LWLockHeldByMe(LWLock *l)
+LWLockHeldByMe(LWLock *lock)
{
int i;
for (i = 0; i < num_held_lwlocks; i++)
{
- if (held_lwlocks[i].lock == l)
+ if (held_lwlocks[i].lock == lock)
return true;
}
return false;
* This is meant as debug support only.
*/
bool
-LWLockAnyHeldByMe(LWLock *l, int nlocks, size_t stride)
+LWLockAnyHeldByMe(LWLock *lock, int nlocks, size_t stride)
{
char *held_lock_addr;
char *begin;
char *end;
int i;
- begin = (char *) l;
+ begin = (char *) lock;
end = begin + nlocks * stride;
for (i = 0; i < num_held_lwlocks; i++)
{
* This is meant as debug support only.
*/
bool
-LWLockHeldByMeInMode(LWLock *l, LWLockMode mode)
+LWLockHeldByMeInMode(LWLock *lock, LWLockMode mode)
{
int i;
for (i = 0; i < num_held_lwlocks; i++)
{
- if (held_lwlocks[i].lock == l && held_lwlocks[i].mode == mode)
+ if (held_lwlocks[i].lock == lock && held_lwlocks[i].mode == mode)
return true;
}
return false;
static uint32 predicatelock_hash(const void *key, Size keysize);
static void SummarizeOldestCommittedSxact(void);
-static Snapshot GetSafeSnapshot(Snapshot snapshot);
+static Snapshot GetSafeSnapshot(Snapshot origSnapshot);
static Snapshot GetSerializableTransactionSnapshotInt(Snapshot snapshot,
VirtualTransactionId *sourcevxid,
int sourcepid);
/* local routines */
-static void mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum,
+static void mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forknum,
bool isRedo);
static MdfdVec *mdopenfork(SMgrRelation reln, ForkNumber forknum, int behavior);
static void register_dirty_segment(SMgrRelation reln, ForkNumber forknum,
int nseg);
static char *_mdfd_segpath(SMgrRelation reln, ForkNumber forknum,
BlockNumber segno);
-static MdfdVec *_mdfd_openseg(SMgrRelation reln, ForkNumber forkno,
+static MdfdVec *_mdfd_openseg(SMgrRelation reln, ForkNumber forknum,
BlockNumber segno, int oflags);
-static MdfdVec *_mdfd_getseg(SMgrRelation reln, ForkNumber forkno,
+static MdfdVec *_mdfd_getseg(SMgrRelation reln, ForkNumber forknum,
BlockNumber blkno, bool skipFsync, int behavior);
static BlockNumber _mdnblocks(SMgrRelation reln, ForkNumber forknum,
MdfdVec *seg);
* Note: this will return true for lingering files, with pending deletions
*/
bool
-mdexists(SMgrRelation reln, ForkNumber forkNum)
+mdexists(SMgrRelation reln, ForkNumber forknum)
{
/*
* Close it first, to ensure that we notice if the fork has been unlinked
* which already closes relations when dropping them.
*/
if (!InRecovery)
- mdclose(reln, forkNum);
+ mdclose(reln, forknum);
- return (mdopenfork(reln, forkNum, EXTENSION_RETURN_NULL) != NULL);
+ return (mdopenfork(reln, forknum, EXTENSION_RETURN_NULL) != NULL);
}
/*
* If isRedo is true, it's okay for the relation to exist already.
*/
void
-mdcreate(SMgrRelation reln, ForkNumber forkNum, bool isRedo)
+mdcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo)
{
MdfdVec *mdfd;
char *path;
File fd;
- if (isRedo && reln->md_num_open_segs[forkNum] > 0)
+ if (isRedo && reln->md_num_open_segs[forknum] > 0)
return; /* created and opened already... */
- Assert(reln->md_num_open_segs[forkNum] == 0);
+ Assert(reln->md_num_open_segs[forknum] == 0);
/*
* We may be using the target table space for the first time in this
reln->smgr_rlocator.locator.dbOid,
isRedo);
- path = relpath(reln->smgr_rlocator, forkNum);
+ path = relpath(reln->smgr_rlocator, forknum);
fd = PathNameOpenFile(path, O_RDWR | O_CREAT | O_EXCL | PG_BINARY);
pfree(path);
- _fdvec_resize(reln, forkNum, 1);
- mdfd = &reln->md_seg_fds[forkNum][0];
+ _fdvec_resize(reln, forknum, 1);
+ mdfd = &reln->md_seg_fds[forknum][0];
mdfd->mdfd_vfd = fd;
mdfd->mdfd_segno = 0;
}
* Note that we're passed a RelFileLocatorBackend --- by the time this is called,
* there won't be an SMgrRelation hashtable entry anymore.
*
- * forkNum can be a fork number to delete a specific fork, or InvalidForkNumber
+ * forknum can be a fork number to delete a specific fork, or InvalidForkNumber
* to delete all forks.
*
* For regular relations, we don't unlink the first segment file of the rel,
* we are usually not in a transaction anymore when this is called.
*/
void
-mdunlink(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
+mdunlink(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo)
{
/* Now do the per-fork work */
- if (forkNum == InvalidForkNumber)
+ if (forknum == InvalidForkNumber)
{
- for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++)
- mdunlinkfork(rlocator, forkNum, isRedo);
+ for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
+ mdunlinkfork(rlocator, forknum, isRedo);
}
else
- mdunlinkfork(rlocator, forkNum, isRedo);
+ mdunlinkfork(rlocator, forknum, isRedo);
}
/*
}
static void
-mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forkNum, bool isRedo)
+mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo)
{
char *path;
int ret;
BlockNumber segno = 0;
- path = relpath(rlocator, forkNum);
+ path = relpath(rlocator, forknum);
/*
* Delete or truncate the first segment.
*/
- if (isRedo || forkNum != MAIN_FORKNUM || RelFileLocatorBackendIsTemp(rlocator))
+ if (isRedo || forknum != MAIN_FORKNUM || RelFileLocatorBackendIsTemp(rlocator))
{
if (!RelFileLocatorBackendIsTemp(rlocator))
{
ret = do_truncate(path);
/* Forget any pending sync requests for the first segment */
- register_forget_request(rlocator, forkNum, 0 /* first seg */ );
+ register_forget_request(rlocator, forknum, 0 /* first seg */ );
}
else
ret = 0;
*/
if (!IsBinaryUpgrade)
{
- register_unlink_segment(rlocator, forkNum, 0 /* first seg */ );
+ register_unlink_segment(rlocator, forknum, 0 /* first seg */ );
++segno;
}
}
* Forget any pending sync requests for this segment before we
* try to unlink.
*/
- register_forget_request(rlocator, forkNum, segno);
+ register_forget_request(rlocator, forknum, segno);
}
if (unlink(segpath) < 0)
static int mic2sjis(const unsigned char *mic, unsigned char *p, int len, bool noError);
static int euc_jp2mic(const unsigned char *euc, unsigned char *p, int len, bool noError);
static int mic2euc_jp(const unsigned char *mic, unsigned char *p, int len, bool noError);
-static int euc_jp2sjis(const unsigned char *mic, unsigned char *p, int len, bool noError);
-static int sjis2euc_jp(const unsigned char *mic, unsigned char *p, int len, bool noError);
+static int euc_jp2sjis(const unsigned char *euc, unsigned char *p, int len, bool noError);
+static int sjis2euc_jp(const unsigned char *sjis, unsigned char *p, int len, bool noError);
Datum
euc_jp_to_sjis(PG_FUNCTION_ARGS)
*/
static int euc_tw2big5(const unsigned char *euc, unsigned char *p, int len, bool noError);
-static int big52euc_tw(const unsigned char *euc, unsigned char *p, int len, bool noError);
+static int big52euc_tw(const unsigned char *big5, unsigned char *p, int len, bool noError);
static int big52mic(const unsigned char *big5, unsigned char *p, int len, bool noError);
static int mic2big5(const unsigned char *mic, unsigned char *p, int len, bool noError);
static int euc_tw2mic(const unsigned char *euc, unsigned char *p, int len, bool noError);
extern void index_endscan(IndexScanDesc scan);
extern void index_markpos(IndexScanDesc scan);
extern void index_restrpos(IndexScanDesc scan);
-extern Size index_parallelscan_estimate(Relation indexrel, Snapshot snapshot);
-extern void index_parallelscan_initialize(Relation heaprel, Relation indexrel,
- Snapshot snapshot, ParallelIndexScanDesc target);
+extern Size index_parallelscan_estimate(Relation indexRelation, Snapshot snapshot);
+extern void index_parallelscan_initialize(Relation heapRelation,
+ Relation indexRelation, Snapshot snapshot,
+ ParallelIndexScanDesc target);
extern void index_parallelrescan(IndexScanDesc scan);
extern IndexScanDesc index_beginscan_parallel(Relation heaprel,
Relation indexrel, int nkeys, int norderbys,
Oid *orderByTypes,
IndexOrderByDistance *distances,
bool recheckOrderBy);
-extern bytea *index_opclass_options(Relation relation, AttrNumber attnum,
+extern bytea *index_opclass_options(Relation indrel, AttrNumber attnum,
Datum attoptions, bool validate);
extern void generic_redo(XLogReaderState *record);
extern const char *generic_identify(uint8 info);
extern void generic_desc(StringInfo buf, XLogReaderState *record);
-extern void generic_mask(char *pagedata, BlockNumber blkno);
+extern void generic_mask(char *page, BlockNumber blkno);
#endif /* GENERIC_XLOG_H */
*/
typedef struct GinVacuumState GinVacuumState;
-extern void ginVacuumPostingTreeLeaf(Relation rel, Buffer buf, GinVacuumState *gvs);
+extern void ginVacuumPostingTreeLeaf(Relation indexrel, Buffer buffer,
+ GinVacuumState *gvs);
/* ginscan.c */
extern IndexScanDesc ginbeginscan(Relation rel, int nkeys, int norderbys);
extern void ginendscan(IndexScanDesc scan);
-extern void ginrescan(IndexScanDesc scan, ScanKey key, int nscankeys,
+extern void ginrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
ScanKey orderbys, int norderbys);
extern void ginNewScanKey(IndexScanDesc scan);
extern void ginFreeScanKeys(GinScanOpaque so);
extern GinPostingList *ginCompressPostingList(const ItemPointer ipd, int nipd,
int maxsize, int *nwritten);
-extern int ginPostingListDecodeAllSegmentsToTbm(GinPostingList *ptr, int totalsize, TIDBitmap *tbm);
+extern int ginPostingListDecodeAllSegmentsToTbm(GinPostingList *ptr, int len, TIDBitmap *tbm);
-extern ItemPointer ginPostingListDecodeAllSegments(GinPostingList *ptr, int len, int *ndecoded);
-extern ItemPointer ginPostingListDecode(GinPostingList *ptr, int *ndecoded);
+extern ItemPointer ginPostingListDecodeAllSegments(GinPostingList *segment, int len,
+ int *ndecoded_out);
+extern ItemPointer ginPostingListDecode(GinPostingList *plist, int *ndecoded_out);
extern ItemPointer ginMergeItemPointers(ItemPointerData *a, uint32 na,
ItemPointerData *b, uint32 nb,
int *nmerged);
extern XLogRecPtr gistXLogUpdate(Buffer buffer,
OffsetNumber *todelete, int ntodelete,
- IndexTuple *itup, int ntup,
- Buffer leftchild);
+ IndexTuple *itup, int ituplen,
+ Buffer leftchildbuf);
extern XLogRecPtr gistXLogDelete(Buffer buffer, OffsetNumber *todelete,
int ntodelete, TransactionId latestRemovedXid);
extern XLogRecPtr gistXLogSplit(bool page_is_leaf,
SplitedPageLayout *dist,
- BlockNumber origrlink, GistNSN oldnsn,
- Buffer leftchild, bool markfollowright);
+ BlockNumber origrlink, GistNSN orignsn,
+ Buffer leftchildbuf, bool markfollowright);
extern XLogRecPtr gistXLogAssignLSN(void);
bool l, bool isNull);
extern float gistpenalty(GISTSTATE *giststate, int attno,
- GISTENTRY *key1, bool isNull1,
- GISTENTRY *key2, bool isNull2);
+ GISTENTRY *orig, bool isNullOrig,
+ GISTENTRY *add, bool isNullAdd);
extern void gistMakeUnionItVec(GISTSTATE *giststate, IndexTuple *itvec, int len,
Datum *attr, bool *isnull);
extern bool gistKeyIsEQ(GISTSTATE *giststate, int attno, Datum a, Datum b);
int maxLevel);
extern GISTNodeBuffer *gistGetNodeBuffer(GISTBuildBuffers *gfbb,
GISTSTATE *giststate,
- BlockNumber blkno, int level);
+ BlockNumber nodeBlocknum, int level);
extern void gistPushItupToNodeBuffer(GISTBuildBuffers *gfbb,
- GISTNodeBuffer *nodeBuffer, IndexTuple item);
+ GISTNodeBuffer *nodeBuffer, IndexTuple itup);
extern bool gistPopItupFromNodeBuffer(GISTBuildBuffers *gfbb,
- GISTNodeBuffer *nodeBuffer, IndexTuple *item);
+ GISTNodeBuffer *nodeBuffer, IndexTuple *itup);
extern void gistFreeBuildBuffers(GISTBuildBuffers *gfbb);
extern void gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb,
GISTSTATE *giststate, Relation r,
const char *default_val, validate_string_relopt validator,
LOCKMODE lockmode);
-extern void init_local_reloptions(local_relopts *opts, Size relopt_struct_size);
-extern void register_reloptions_validator(local_relopts *opts,
+extern void init_local_reloptions(local_relopts *relopts, Size relopt_struct_size);
+extern void register_reloptions_validator(local_relopts *relopts,
relopts_validator validator);
-extern void add_local_bool_reloption(local_relopts *opts, const char *name,
+extern void add_local_bool_reloption(local_relopts *relopts, const char *name,
const char *desc, bool default_val,
int offset);
-extern void add_local_int_reloption(local_relopts *opts, const char *name,
+extern void add_local_int_reloption(local_relopts *relopts, const char *name,
const char *desc, int default_val,
int min_val, int max_val, int offset);
-extern void add_local_real_reloption(local_relopts *opts, const char *name,
+extern void add_local_real_reloption(local_relopts *relopts, const char *name,
const char *desc, double default_val,
double min_val, double max_val,
int offset);
relopt_enum_elt_def *members,
int default_val, const char *detailmsg,
int offset);
-extern void add_local_string_reloption(local_relopts *opts, const char *name,
+extern void add_local_string_reloption(local_relopts *relopts, const char *name,
const char *desc,
const char *default_val,
validate_string_relopt validator,
extern TupleTableSlot *execute_attr_map_slot(AttrMap *attrMap,
TupleTableSlot *in_slot,
TupleTableSlot *out_slot);
-extern Bitmapset *execute_attr_map_cols(AttrMap *attrMap, Bitmapset *inbitmap);
+extern Bitmapset *execute_attr_map_cols(AttrMap *attrMap, Bitmapset *in_cols);
extern void free_conversion_map(TupleConversionMap *map);
extern bool equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2);
-extern uint32 hashTupleDesc(TupleDesc tupdesc);
+extern uint32 hashTupleDesc(TupleDesc desc);
extern void TupleDescInitEntry(TupleDesc desc,
AttrNumber attributeNumber,
XLogRecPtr end_lsn, RepOriginId origin_id);
extern void PrepareRedoRemove(TransactionId xid, bool giveWarning);
extern void restoreTwoPhaseData(void);
-extern bool LookupGXact(const char *gid, XLogRecPtr prepare_at_lsn,
+extern bool LookupGXact(const char *gid, XLogRecPtr prepare_end_lsn,
TimestampTz origin_prepare_timestamp);
#endif /* TWOPHASE_H */
extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time,
int nsubxacts, TransactionId *subxacts,
int nrels, RelFileLocator *rels,
- int nstats,
- xl_xact_stats_item *stats,
+ int ndroppedstats,
+ xl_xact_stats_item *droppedstats,
int nmsgs, SharedInvalidationMessage *msgs,
bool relcacheInval,
int xactflags,
extern XLogRecPtr XactLogAbortRecord(TimestampTz abort_time,
int nsubxacts, TransactionId *subxacts,
int nrels, RelFileLocator *rels,
- int nstats,
- xl_xact_stats_item *stats,
+ int ndroppedstats,
+ xl_xact_stats_item *droppedstats,
int xactflags, TransactionId twophase_xid,
const char *twophase_gid);
extern void xact_redo(XLogReaderState *record);
uint8 flags,
int num_fpi,
bool topxid_included);
-extern void XLogFlush(XLogRecPtr RecPtr);
+extern void XLogFlush(XLogRecPtr record);
extern bool XLogBackgroundFlush(void);
-extern bool XLogNeedsFlush(XLogRecPtr RecPtr);
-extern int XLogFileInit(XLogSegNo segno, TimeLineID tli);
+extern bool XLogNeedsFlush(XLogRecPtr record);
+extern int XLogFileInit(XLogSegNo logsegno, TimeLineID logtli);
extern int XLogFileOpen(XLogSegNo segno, TimeLineID tli);
extern void CheckXLogRemoved(XLogSegNo segno, TimeLineID tli);
extern XLogSegNo XLogGetLastRemovedSegno(void);
-extern void XLogSetAsyncXactLSN(XLogRecPtr record);
+extern void XLogSetAsyncXactLSN(XLogRecPtr asyncXactLSN);
extern void XLogSetReplicationSlotMinimumLSN(XLogRecPtr lsn);
extern void xlog_redo(XLogReaderState *record);
extern void XLogResetInsertion(void);
extern bool XLogCheckBufferNeedsBackup(Buffer buffer);
-extern XLogRecPtr log_newpage(RelFileLocator *rlocator, ForkNumber forkNum,
- BlockNumber blk, char *page, bool page_std);
-extern void log_newpages(RelFileLocator *rlocator, ForkNumber forkNum, int num_pages,
+extern XLogRecPtr log_newpage(RelFileLocator *rlocator, ForkNumber forknum,
+ BlockNumber blkno, char *page, bool page_std);
+extern void log_newpages(RelFileLocator *rlocator, ForkNumber forknum, int num_pages,
BlockNumber *blknos, char **pages, bool page_std);
extern XLogRecPtr log_newpage_buffer(Buffer buffer, bool page_std);
-extern void log_newpage_range(Relation rel, ForkNumber forkNum,
+extern void log_newpage_range(Relation rel, ForkNumber forknum,
BlockNumber startblk, BlockNumber endblk, bool page_std);
extern XLogRecPtr XLogSaveBufferForHint(Buffer buffer, bool buffer_std);
DecodedXLogRecord *decoded,
XLogRecord *record,
XLogRecPtr lsn,
- char **errmsg);
+ char **errormsg);
/*
* Macros that provide access to parts of the record most recently returned by
extern Size XLogRecoveryShmemSize(void);
extern void XLogRecoveryShmemInit(void);
-extern void InitWalRecovery(ControlFileData *ControlFile, bool *wasShutdownPtr, bool *haveBackupLabel, bool *haveTblspcMap);
+extern void InitWalRecovery(ControlFileData *ControlFile,
+ bool *wasShutdown_ptr, bool *haveBackupLabel_ptr,
+ bool *haveTblspcMap_ptr);
extern void PerformWalRecovery(void);
/*
} ReadLocalXLogPageNoWaitPrivate;
extern XLogRedoAction XLogReadBufferForRedo(XLogReaderState *record,
- uint8 buffer_id, Buffer *buf);
+ uint8 block_id, Buffer *buf);
extern Buffer XLogInitBufferForRedo(XLogReaderState *record, uint8 block_id);
extern XLogRedoAction XLogReadBufferForRedoExtended(XLogReaderState *record,
- uint8 buffer_id,
+ uint8 block_id,
ReadBufferMode mode, bool get_cleanup_lock,
Buffer *buf);
extern void changeDependencyOnTablespace(Oid classId, Oid objectId,
Oid newTablespaceId);
-extern void updateAclDependencies(Oid classId, Oid objectId, int32 objectSubId,
+extern void updateAclDependencies(Oid classId, Oid objectId, int32 objsubId,
Oid ownerId,
int noldmembers, Oid *oldmembers,
int nnewmembers, Oid *newmembers);
extern void dropDatabaseDependencies(Oid databaseId);
-extern void shdepDropOwned(List *relids, DropBehavior behavior);
+extern void shdepDropOwned(List *roleids, DropBehavior behavior);
-extern void shdepReassignOwned(List *relids, Oid newrole);
+extern void shdepReassignOwned(List *roleids, Oid newrole);
#endif /* DEPENDENCY_H */
extern Oid IndexGetRelation(Oid indexId, bool missing_ok);
extern void reindex_index(Oid indexId, bool skip_constraint_checks,
- char relpersistence, ReindexParams *params);
+ char persistence, ReindexParams *params);
/* Flag bits for reindex_relation(): */
#define REINDEX_REL_PROCESS_TOAST 0x01
extern void SerializeReindexState(Size maxsize, char *start_address);
extern void RestoreReindexState(void *reindexstate);
-extern void IndexSetParentIndex(Relation idx, Oid parentOid);
+extern void IndexSetParentIndex(Relation partitionIdx, Oid parentOid);
/*
RangeVarGetRelidCallback callback,
void *callback_arg);
extern Oid RangeVarGetCreationNamespace(const RangeVar *newRelation);
-extern Oid RangeVarGetAndCheckCreationNamespace(RangeVar *newRelation,
+extern Oid RangeVarGetAndCheckCreationNamespace(RangeVar *relation,
LOCKMODE lockmode,
Oid *existing_relation_id);
extern void RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid);
extern void RunFunctionExecuteHook(Oid objectId);
/* String versions */
-extern void RunObjectPostCreateHookStr(Oid classId, const char *objectStr, int subId,
+extern void RunObjectPostCreateHookStr(Oid classId, const char *objectName, int subId,
bool is_internal);
-extern void RunObjectDropHookStr(Oid classId, const char *objectStr, int subId,
+extern void RunObjectDropHookStr(Oid classId, const char *objectName, int subId,
int dropflags);
-extern void RunObjectTruncateHookStr(const char *objectStr);
-extern void RunObjectPostAlterHookStr(Oid classId, const char *objectStr, int subId,
+extern void RunObjectTruncateHookStr(const char *objectName);
+extern void RunObjectPostAlterHookStr(Oid classId, const char *objectName, int subId,
Oid auxiliaryId, bool is_internal);
-extern bool RunNamespaceSearchHookStr(const char *objectStr, bool ereport_on_violation);
-extern void RunFunctionExecuteHookStr(const char *objectStr);
+extern bool RunNamespaceSearchHookStr(const char *objectName, bool ereport_on_violation);
+extern void RunFunctionExecuteHookStr(const char *objectName);
/*
extern int read_objtype_from_string(const char *objtype);
extern char *getObjectTypeDescription(const ObjectAddress *object,
bool missing_ok);
-extern char *getObjectIdentity(const ObjectAddress *address,
+extern char *getObjectIdentity(const ObjectAddress *object,
bool missing_ok);
-extern char *getObjectIdentityParts(const ObjectAddress *address,
+extern char *getObjectIdentityParts(const ObjectAddress *object,
List **objname, List **objargs,
bool missing_ok);
extern struct ArrayType *strlist_to_textarray(List *list);
Oid conowner,
int32 conforencoding, int32 contoencoding,
Oid conproc, bool def);
-extern Oid FindDefaultConversion(Oid connamespace, int32 for_encoding,
+extern Oid FindDefaultConversion(Oid name_space, int32 for_encoding,
int32 to_encoding);
#endif /* PG_CONVERSION_H */
LOCKMODE lockmode, bool *detached_exist, TransactionId *detached_xmin);
extern List *find_all_inheritors(Oid parentrelId, LOCKMODE lockmode,
- List **parents);
+ List **numparents);
extern bool has_subclass(Oid relationId);
extern bool has_superclass(Oid relationId);
extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId);
extern void StoreSingleInheritance(Oid relationId, Oid parentOid,
int32 seqNumber);
-extern bool DeleteInheritsTuple(Oid inhrelid, Oid inhparent, bool allow_detached,
+extern bool DeleteInheritsTuple(Oid inhrelid, Oid inhparent,
+ bool expect_detach_pending,
const char *childname);
extern bool PartitionHasPendingDetach(Oid partoid);
extern List *GetSchemaPublications(Oid schemaid);
extern List *GetSchemaPublicationRelations(Oid schemaid,
PublicationPartOpt pub_partopt);
-extern List *GetAllSchemaPublicationRelations(Oid puboid,
+extern List *GetAllSchemaPublicationRelations(Oid pubid,
PublicationPartOpt pub_partopt);
extern List *GetPubPartitionOptionRelations(List *result,
PublicationPartOpt pub_partopt,
typedef int (*copy_data_source_cb) (void *outbuf, int minread, int maxread);
-extern void DoCopy(ParseState *state, const CopyStmt *stmt,
+extern void DoCopy(ParseState *pstate, const CopyStmt *stmt,
int stmt_location, int stmt_len,
uint64 *processed);
-extern void ProcessCopyOptions(ParseState *pstate, CopyFormatOptions *ops_out, bool is_from, List *options);
+extern void ProcessCopyOptions(ParseState *pstate, CopyFormatOptions *opts_out, bool is_from, List *options);
extern CopyFromState BeginCopyFrom(ParseState *pstate, Relation rel, Node *whereClause,
const char *filename,
bool is_program, copy_data_source_cb data_source_cb, List *attnamelist, List *options);
/*
* internal prototypes
*/
-extern CopyToState BeginCopyTo(ParseState *pstate, Relation rel, RawStmt *query,
+extern CopyToState BeginCopyTo(ParseState *pstate, Relation rel, RawStmt *raw_query,
Oid queryRelId, const char *filename, bool is_program,
List *attnamelist, List *options);
extern void EndCopyTo(CopyToState cstate);
} xl_dbase_drop_rec;
#define MinSizeOfDbaseDropRec offsetof(xl_dbase_drop_rec, tablespace_ids)
-extern void dbase_redo(XLogReaderState *rptr);
-extern void dbase_desc(StringInfo buf, XLogReaderState *rptr);
+extern void dbase_redo(XLogReaderState *record);
+extern void dbase_desc(StringInfo buf, XLogReaderState *record);
extern const char *dbase_identify(uint8 info);
#endif /* DBCOMMANDS_XLOG_H */
} ParallelExecutorInfo;
extern ParallelExecutorInfo *ExecInitParallelPlan(PlanState *planstate,
- EState *estate, Bitmapset *sendParam, int nworkers,
+ EState *estate, Bitmapset *sendParams, int nworkers,
int64 tuples_needed);
extern void ExecParallelCreateReaders(ParallelExecutorInfo *pei);
extern void ExecParallelFinish(ParallelExecutorInfo *pei);
extern void ExecParallelCleanup(ParallelExecutorInfo *pei);
extern void ExecParallelReinitialize(PlanState *planstate,
- ParallelExecutorInfo *pei, Bitmapset *sendParam);
+ ParallelExecutorInfo *pei, Bitmapset *sendParams);
extern void ParallelQueryMain(dsm_segment *seg, shm_toc *toc);
extern ExecRowMark *ExecFindRowMark(EState *estate, Index rti, bool missing_ok);
extern ExecAuxRowMark *ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist);
extern TupleTableSlot *EvalPlanQual(EPQState *epqstate, Relation relation,
- Index rti, TupleTableSlot *testslot);
+ Index rti, TupleTableSlot *inputslot);
extern void EvalPlanQualInit(EPQState *epqstate, EState *parentestate,
Plan *subplan, List *auxrowmarks, int epqParam);
extern void EvalPlanQualSetPlan(EPQState *epqstate,
}
#endif
-extern bool ExecCheck(ExprState *state, ExprContext *context);
+extern bool ExecCheck(ExprState *state, ExprContext *econtext);
/*
* prototypes from functions in execSRF.c
extern void ExecInitResultTupleSlotTL(PlanState *planstate,
const TupleTableSlotOps *tts_ops);
extern void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate,
- TupleDesc tupleDesc,
+ TupleDesc tupledesc,
const TupleTableSlotOps *tts_ops);
extern TupleTableSlot *ExecInitExtraTupleSlot(EState *estate,
TupleDesc tupledesc,
/* parallel instrumentation support */
extern void ExecIncrementalSortEstimate(IncrementalSortState *node, ParallelContext *pcxt);
extern void ExecIncrementalSortInitializeDSM(IncrementalSortState *node, ParallelContext *pcxt);
-extern void ExecIncrementalSortInitializeWorker(IncrementalSortState *node, ParallelWorkerContext *pcxt);
+extern void ExecIncrementalSortInitializeWorker(IncrementalSortState *node, ParallelWorkerContext *pwcxt);
extern void ExecIncrementalSortRetrieveInstrumentation(IncrementalSortState *node);
#endif /* NODEINCREMENTALSORT_H */
extern void *SPI_repalloc(void *pointer, Size size);
extern void SPI_pfree(void *pointer);
extern Datum SPI_datumTransfer(Datum value, bool typByVal, int typLen);
-extern void SPI_freetuple(HeapTuple pointer);
+extern void SPI_freetuple(HeapTuple tuple);
extern void SPI_freetuptable(SPITupleTable *tuptable);
extern Portal SPI_cursor_open(const char *name, SPIPlanPtr plan,
extern int pg_char_and_wchar_strcmp(const char *s1, const pg_wchar *s2);
extern int pg_wchar_strncmp(const pg_wchar *s1, const pg_wchar *s2, size_t n);
extern int pg_char_and_wchar_strncmp(const char *s1, const pg_wchar *s2, size_t n);
-extern size_t pg_wchar_strlen(const pg_wchar *wstr);
+extern size_t pg_wchar_strlen(const pg_wchar *str);
extern int pg_mblen(const char *mbstr);
extern int pg_dsplen(const char *mbstr);
extern int pg_mbstrlen(const char *mbstr);
-extern int pg_mbstrlen_with_len(const char *mbstr, int len);
+extern int pg_mbstrlen_with_len(const char *mbstr, int limit);
extern int pg_mbcliplen(const char *mbstr, int len, int limit);
extern int pg_encoding_mbcliplen(int encoding, const char *mbstr,
int len, int limit);
int src_encoding,
int dest_encoding,
unsigned char *src, int srclen,
- unsigned char *dst, int dstlen,
+ unsigned char *dest, int destlen,
bool noError);
extern char *pg_client_to_server(const char *s, int len);
extern bool InNoForceRLSOperation(void);
extern void GetUserIdAndContext(Oid *userid, bool *sec_def_context);
extern void SetUserIdAndContext(Oid userid, bool sec_def_context);
-extern void InitializeSessionUserId(const char *rolename, Oid useroid);
+extern void InitializeSessionUserId(const char *rolename, Oid roleid);
extern void InitializeSessionUserIdStandalone(void);
extern void SetSessionAuthorization(Oid userid, bool is_superuser);
extern Oid GetCurrentRoleId(void);
extern bool DecodingContextReady(LogicalDecodingContext *ctx);
extern void FreeDecodingContext(LogicalDecodingContext *ctx);
-extern void LogicalIncreaseXminForSlot(XLogRecPtr lsn, TransactionId xmin);
+extern void LogicalIncreaseXminForSlot(XLogRecPtr current_lsn,
+ TransactionId xmin);
extern void LogicalIncreaseRestartDecodingForSlot(XLogRecPtr current_lsn,
XLogRecPtr restart_lsn);
extern void LogicalConfirmReceivedLocation(XLogRecPtr lsn);
bool *has_oldtuple, LogicalRepTupleData *oldtup,
LogicalRepTupleData *newtup);
extern void logicalrep_write_delete(StringInfo out, TransactionId xid,
- Relation rel, TupleTableSlot *oldtuple,
+ Relation rel, TupleTableSlot *oldslot,
bool binary);
extern LogicalRepRelId logicalrep_read_delete(StringInfo in,
LogicalRepTupleData *oldtup);
extern LogicalRepRelation *logicalrep_read_rel(StringInfo in);
extern void logicalrep_write_typ(StringInfo out, TransactionId xid,
Oid typoid);
-extern void logicalrep_read_typ(StringInfo out, LogicalRepTyp *ltyp);
+extern void logicalrep_read_typ(StringInfo in, LogicalRepTyp *ltyp);
extern void logicalrep_write_stream_start(StringInfo out, TransactionId xid,
bool first_segment);
extern TransactionId logicalrep_read_stream_start(StringInfo in,
extern void logicalrep_write_stream_stop(StringInfo out);
extern void logicalrep_write_stream_commit(StringInfo out, ReorderBufferTXN *txn,
XLogRecPtr commit_lsn);
-extern TransactionId logicalrep_read_stream_commit(StringInfo out,
+extern TransactionId logicalrep_read_stream_commit(StringInfo in,
LogicalRepCommitData *commit_data);
extern void logicalrep_write_stream_abort(StringInfo out, TransactionId xid,
TransactionId subxid);
extern PGDLLIMPORT TimestampTz replorigin_session_origin_timestamp;
/* API for querying & manipulating replication origins */
-extern RepOriginId replorigin_by_name(const char *name, bool missing_ok);
-extern RepOriginId replorigin_create(const char *name);
+extern RepOriginId replorigin_by_name(const char *roname, bool missing_ok);
+extern RepOriginId replorigin_create(const char *roname);
extern void replorigin_drop_by_name(const char *name, bool missing_ok, bool nowait);
extern bool replorigin_by_oid(RepOriginId roident, bool missing_ok,
char **roname);
/* management of individual slots */
extern void ReplicationSlotCreate(const char *name, bool db_specific,
- ReplicationSlotPersistency p, bool two_phase);
+ ReplicationSlotPersistency persistency,
+ bool two_phase);
extern void ReplicationSlotPersist(void);
extern void ReplicationSlotDrop(const char *name, bool nowait);
extern PGDLLIMPORT bool log_replication_commands;
extern void InitWalSender(void);
-extern bool exec_replication_command(const char *query_string);
+extern bool exec_replication_command(const char *cmd_string);
extern void WalSndErrorCleanup(void);
extern void WalSndResourceCleanup(bool isCommit);
extern void WalSndSignals(void);
ConditionVariable condition_variable;
} Barrier;
-extern void BarrierInit(Barrier *barrier, int num_workers);
+extern void BarrierInit(Barrier *barrier, int participants);
extern bool BarrierArriveAndWait(Barrier *barrier, uint32 wait_event_info);
extern bool BarrierArriveAndDetach(Barrier *barrier);
extern bool BarrierArriveAndDetachExceptLast(Barrier *barrier);
extern Size PageGetFreeSpaceForMultipleTuples(Page page, int ntups);
extern Size PageGetExactFreeSpace(Page page);
extern Size PageGetHeapFreeSpace(Page page);
-extern void PageIndexTupleDelete(Page page, OffsetNumber offset);
+extern void PageIndexTupleDelete(Page page, OffsetNumber offnum);
extern void PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems);
-extern void PageIndexTupleDeleteNoCompact(Page page, OffsetNumber offset);
+extern void PageIndexTupleDeleteNoCompact(Page page, OffsetNumber offnum);
extern bool PageIndexTupleOverwrite(Page page, OffsetNumber offnum,
Item newtup, Size newsize);
extern char *PageSetChecksumCopy(Page page, BlockNumber blkno);
extern void dsm_pin_mapping(dsm_segment *seg);
extern void dsm_unpin_mapping(dsm_segment *seg);
extern void dsm_pin_segment(dsm_segment *seg);
-extern void dsm_unpin_segment(dsm_handle h);
-extern dsm_segment *dsm_find_mapping(dsm_handle h);
+extern void dsm_unpin_segment(dsm_handle handle);
+extern dsm_segment *dsm_find_mapping(dsm_handle handle);
/* Informational functions. */
extern void *dsm_segment_address(dsm_segment *seg);
extern mode_t FileGetRawMode(File file);
/* Operations used for sharing named temporary files */
-extern File PathNameCreateTemporaryFile(const char *name, bool error_on_failure);
+extern File PathNameCreateTemporaryFile(const char *path, bool error_on_failure);
extern File PathNameOpenTemporaryFile(const char *path, int mode);
-extern bool PathNameDeleteTemporaryFile(const char *name, bool error_on_failure);
-extern void PathNameCreateTemporaryDir(const char *base, const char *name);
-extern void PathNameDeleteTemporaryDir(const char *name);
+extern bool PathNameDeleteTemporaryFile(const char *path, bool error_on_failure);
+extern void PathNameCreateTemporaryDir(const char *basedir, const char *directory);
+extern void PathNameDeleteTemporaryDir(const char *dirname);
extern void TempTablespacePath(char *path, Oid tablespace);
/* Operations that allow use of regular stdio --- USE WITH CAUTION */
extern int pg_fsync_no_writethrough(int fd);
extern int pg_fsync_writethrough(int fd);
extern int pg_fdatasync(int fd);
-extern void pg_flush_data(int fd, off_t offset, off_t amount);
+extern void pg_flush_data(int fd, off_t offset, off_t nbytes);
extern ssize_t pg_pwritev_with_retry(int fd,
const struct iovec *iov,
int iovcnt,
extern int pg_truncate(const char *path, off_t length);
extern void fsync_fname(const char *fname, bool isdir);
extern int fsync_fname_ext(const char *fname, bool isdir, bool ignore_perm, int elevel);
-extern int durable_rename(const char *oldfile, const char *newfile, int loglevel);
-extern int durable_unlink(const char *fname, int loglevel);
+extern int durable_rename(const char *oldfile, const char *newfile, int elevel);
+extern int durable_unlink(const char *fname, int elevel);
extern void SyncDataDirectory(void);
extern int data_sync_elevel(int elevel);
#define SlotsPerFSMPage LeafNodesPerPage
/* Prototypes for functions in fsmpage.c */
-extern int fsm_search_avail(Buffer buf, uint8 min_cat, bool advancenext,
+extern int fsm_search_avail(Buffer buf, uint8 minvalue, bool advancenext,
bool exclusive_lock_held);
extern uint8 fsm_get_avail(Page page, int slot);
extern uint8 fsm_get_max_avail(Page page);
#include "utils/relcache.h"
extern BlockNumber GetFreeIndexPage(Relation rel);
-extern void RecordFreeIndexPage(Relation rel, BlockNumber page);
-extern void RecordUsedIndexPage(Relation rel, BlockNumber page);
+extern void RecordFreeIndexPage(Relation rel, BlockNumber freeBlock);
+extern void RecordUsedIndexPage(Relation rel, BlockNumber usedBlock);
extern void IndexFreeSpaceMapVacuum(Relation rel);
extern bool LWLockHeldByMeInMode(LWLock *lock, LWLockMode mode);
extern bool LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval);
-extern void LWLockUpdateVar(LWLock *lock, uint64 *valptr, uint64 value);
+extern void LWLockUpdateVar(LWLock *lock, uint64 *valptr, uint64 val);
extern Size LWLockShmemSize(void);
extern void CreateLWLocks(void);
extern void PredicateLockRelation(Relation relation, Snapshot snapshot);
extern void PredicateLockPage(Relation relation, BlockNumber blkno, Snapshot snapshot);
extern void PredicateLockTID(Relation relation, ItemPointer tid, Snapshot snapshot,
- TransactionId insert_xid);
+ TransactionId tuple_xid);
extern void PredicateLockPageSplit(Relation relation, BlockNumber oldblkno, BlockNumber newblkno);
extern void PredicateLockPageCombine(Relation relation, BlockNumber oldblkno, BlockNumber newblkno);
extern void TransferPredicateLocksToHeapRelation(Relation relation);
extern TransactionId GetOldestTransactionIdConsideredRunning(void);
extern TransactionId GetOldestActiveTransactionId(void);
extern TransactionId GetOldestSafeDecodingTransactionId(bool catalogOnly);
-extern void GetReplicationHorizons(TransactionId *slot_xmin, TransactionId *catalog_xmin);
+extern void GetReplicationHorizons(TransactionId *xmin, TransactionId *catalog_xmin);
extern VirtualTransactionId *GetVirtualXIDsDelayingChkpt(int *nvxids, int type);
extern bool HaveVirtualXIDsDelayingChkpt(VirtualTransactionId *vxids,
extern void StandbyTimeoutHandler(void);
extern void StandbyLockTimeoutHandler(void);
extern void LogRecoveryConflict(ProcSignalReason reason, TimestampTz wait_start,
- TimestampTz cur_ts, VirtualTransactionId *wait_list,
+ TimestampTz now, VirtualTransactionId *wait_list,
bool still_waiting);
/*