1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +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:
Andres Freund
2019-05-23 16:25:48 -07:00
parent 54487d1560
commit 73b8c3bd28
14 changed files with 178 additions and 169 deletions

View File

@@ -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;
}