mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
tableam: Rename wrapper functions to match callback names.
Some of the wrapper functions didn't match the callback names. Many of them due to staying "consistent" with historic naming of the wrapped functionality. We decided that for most cases it's more important to be for tableam to be consistent going forward, than with the past. The one exception is beginscan/endscan/... because it'd have looked odd to have systable_beginscan/endscan/... with a different naming scheme, and changing the systable_* APIs would have caused way too much churn (including breaking a lot of external users). Author: Ashwin Agrawal, with some small additions by Andres Freund Reviewed-By: Andres Freund Discussion: https://postgr.es/m/CALfoeiugyrXZfX7n0ORCa4L-m834dzmaE8eFdbNR6PMpetU4Ww@mail.gmail.com
This commit is contained in:
@ -1866,12 +1866,12 @@ ReleaseBulkInsertStatePin(BulkInsertState bistate)
|
||||
* The new tuple is stamped with current transaction ID and the specified
|
||||
* command ID.
|
||||
*
|
||||
* See table_insert for comments about most of the input flags, except that
|
||||
* this routine directly takes a tuple rather than a slot.
|
||||
* See table_tuple_insert for comments about most of the input flags, except
|
||||
* that this routine directly takes a tuple rather than a slot.
|
||||
*
|
||||
* There's corresponding HEAP_INSERT_ options to all the TABLE_INSERT_
|
||||
* options, and there additionally is HEAP_INSERT_SPECULATIVE which is used to
|
||||
* implement table_insert_speculative().
|
||||
* implement table_tuple_insert_speculative().
|
||||
*
|
||||
* On return the header fields of *tup are updated to match the stored tuple;
|
||||
* in particular tup->t_self receives the actual TID where the tuple was
|
||||
@ -2444,8 +2444,8 @@ xmax_infomask_changed(uint16 new_infomask, uint16 old_infomask)
|
||||
/*
|
||||
* heap_delete - delete a tuple
|
||||
*
|
||||
* See table_delete() for an explanation of the parameters, except that this
|
||||
* routine directly takes a tuple rather than a slot.
|
||||
* See table_tuple_delete() for an explanation of the parameters, except that
|
||||
* this routine directly takes a tuple rather than a slot.
|
||||
*
|
||||
* In the failure cases, the routine fills *tmfd with the tuple's t_ctid,
|
||||
* t_xmax (resolving a possible MultiXact, if necessary), and t_cmax (the last
|
||||
@ -2890,8 +2890,8 @@ simple_heap_delete(Relation relation, ItemPointer tid)
|
||||
/*
|
||||
* heap_update - replace a tuple
|
||||
*
|
||||
* See table_update() for an explanation of the parameters, except that this
|
||||
* routine directly takes a tuple rather than a slot.
|
||||
* See table_tuple_update() for an explanation of the parameters, except that
|
||||
* this routine directly takes a tuple rather than a slot.
|
||||
*
|
||||
* In the failure cases, the routine fills *tmfd with the tuple's t_ctid,
|
||||
* t_xmax (resolving a possible MultiXact, if necessary), and t_cmax (the last
|
||||
@ -3961,7 +3961,7 @@ get_mxact_status_for_lock(LockTupleMode mode, bool is_update)
|
||||
* *buffer: set to buffer holding tuple (pinned but not locked at exit)
|
||||
* *tmfd: filled in failure cases (see below)
|
||||
*
|
||||
* Function results are the same as the ones for table_lock_tuple().
|
||||
* Function results are the same as the ones for table_tuple_lock().
|
||||
*
|
||||
* In the failure cases other than TM_Invisible, the routine fills
|
||||
* *tmfd with the tuple's t_ctid, t_xmax (resolving a possible MultiXact,
|
||||
|
@ -221,7 +221,7 @@ table_index_fetch_tuple_check(Relation rel,
|
||||
*/
|
||||
|
||||
void
|
||||
table_get_latest_tid(TableScanDesc scan, ItemPointer tid)
|
||||
table_tuple_get_latest_tid(TableScanDesc scan, ItemPointer tid)
|
||||
{
|
||||
Relation rel = scan->rs_rd;
|
||||
const TableAmRoutine *tableam = rel->rd_tableam;
|
||||
@ -248,19 +248,19 @@ table_get_latest_tid(TableScanDesc scan, ItemPointer tid)
|
||||
*/
|
||||
|
||||
/*
|
||||
* simple_table_insert - insert a tuple
|
||||
* simple_table_tuple_insert - insert a tuple
|
||||
*
|
||||
* Currently, this routine differs from table_insert only in supplying a
|
||||
* Currently, this routine differs from table_tuple_insert only in supplying a
|
||||
* default command ID and not allowing access to the speedup options.
|
||||
*/
|
||||
void
|
||||
simple_table_insert(Relation rel, TupleTableSlot *slot)
|
||||
simple_table_tuple_insert(Relation rel, TupleTableSlot *slot)
|
||||
{
|
||||
table_insert(rel, slot, GetCurrentCommandId(true), 0, NULL);
|
||||
table_tuple_insert(rel, slot, GetCurrentCommandId(true), 0, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* simple_table_delete - delete a tuple
|
||||
* simple_table_tuple_delete - delete a tuple
|
||||
*
|
||||
* This routine may be used to delete a tuple when concurrent updates of
|
||||
* the target tuple are not expected (for example, because we have a lock
|
||||
@ -268,16 +268,16 @@ simple_table_insert(Relation rel, TupleTableSlot *slot)
|
||||
* via ereport().
|
||||
*/
|
||||
void
|
||||
simple_table_delete(Relation rel, ItemPointer tid, Snapshot snapshot)
|
||||
simple_table_tuple_delete(Relation rel, ItemPointer tid, Snapshot snapshot)
|
||||
{
|
||||
TM_Result result;
|
||||
TM_FailureData tmfd;
|
||||
|
||||
result = table_delete(rel, tid,
|
||||
GetCurrentCommandId(true),
|
||||
snapshot, InvalidSnapshot,
|
||||
true /* wait for commit */ ,
|
||||
&tmfd, false /* changingPart */ );
|
||||
result = table_tuple_delete(rel, tid,
|
||||
GetCurrentCommandId(true),
|
||||
snapshot, InvalidSnapshot,
|
||||
true /* wait for commit */ ,
|
||||
&tmfd, false /* changingPart */ );
|
||||
|
||||
switch (result)
|
||||
{
|
||||
@ -299,13 +299,13 @@ simple_table_delete(Relation rel, ItemPointer tid, Snapshot snapshot)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(ERROR, "unrecognized table_delete status: %u", result);
|
||||
elog(ERROR, "unrecognized table_tuple_delete status: %u", result);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* simple_table_update - replace a tuple
|
||||
* simple_table_tuple_update - replace a tuple
|
||||
*
|
||||
* This routine may be used to update a tuple when concurrent updates of
|
||||
* the target tuple are not expected (for example, because we have a lock
|
||||
@ -313,20 +313,20 @@ simple_table_delete(Relation rel, ItemPointer tid, Snapshot snapshot)
|
||||
* via ereport().
|
||||
*/
|
||||
void
|
||||
simple_table_update(Relation rel, ItemPointer otid,
|
||||
TupleTableSlot *slot,
|
||||
Snapshot snapshot,
|
||||
bool *update_indexes)
|
||||
simple_table_tuple_update(Relation rel, ItemPointer otid,
|
||||
TupleTableSlot *slot,
|
||||
Snapshot snapshot,
|
||||
bool *update_indexes)
|
||||
{
|
||||
TM_Result result;
|
||||
TM_FailureData tmfd;
|
||||
LockTupleMode lockmode;
|
||||
|
||||
result = table_update(rel, otid, slot,
|
||||
GetCurrentCommandId(true),
|
||||
snapshot, InvalidSnapshot,
|
||||
true /* wait for commit */ ,
|
||||
&tmfd, &lockmode, update_indexes);
|
||||
result = table_tuple_update(rel, otid, slot,
|
||||
GetCurrentCommandId(true),
|
||||
snapshot, InvalidSnapshot,
|
||||
true /* wait for commit */ ,
|
||||
&tmfd, &lockmode, update_indexes);
|
||||
|
||||
switch (result)
|
||||
{
|
||||
@ -348,7 +348,7 @@ simple_table_update(Relation rel, ItemPointer otid,
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(ERROR, "unrecognized table_update status: %u", result);
|
||||
elog(ERROR, "unrecognized table_tuple_update status: %u", result);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user