mirror of
https://github.com/postgres/postgres.git
synced 2025-11-01 21:31:19 +03:00
heap_fetch requires buffer pointer, must be released; heap_getnext
no longer returns buffer pointer, can be gotten from scan; descriptor; bootstrap can create multi-key indexes; pg_procname index now is multi-key index; oidint2, oidint4, oidname are gone (must be removed from regression tests); use System Cache rather than sequential scan in many places; heap_modifytuple no longer takes buffer parameter; remove unused buffer parameter in a few other functions; oid8 is not index-able; remove some use of single-character variable names; cleanup Buffer variables usage and scan descriptor looping; cleaned up allocation and freeing of tuples; 18k lines of diff;
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.27 1998/07/27 19:37:39 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.28 1998/08/19 02:01:15 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -53,7 +53,8 @@ _bt_doinsert(Relation rel, BTItem btitem, bool index_is_unique, Relation heapRel
|
||||
BlockNumber blkno;
|
||||
int natts = rel->rd_rel->relnatts;
|
||||
InsertIndexResult res;
|
||||
|
||||
Buffer buffer;
|
||||
|
||||
itup = &(btitem->bti_itup);
|
||||
|
||||
/* we need a scan key to do our search, so build one */
|
||||
@@ -120,11 +121,12 @@ _bt_doinsert(Relation rel, BTItem btitem, bool index_is_unique, Relation heapRel
|
||||
{ /* they're equal */
|
||||
btitem = (BTItem) PageGetItem(page, PageGetItemId(page, offset));
|
||||
itup = &(btitem->bti_itup);
|
||||
htup = heap_fetch(heapRel, SnapshotSelf, &(itup->t_tid), NULL);
|
||||
htup = heap_fetch(heapRel, SnapshotSelf, &(itup->t_tid), &buffer);
|
||||
if (htup != (HeapTuple) NULL)
|
||||
{ /* it is a duplicate */
|
||||
elog(ERROR, "Cannot insert a duplicate key into a unique index");
|
||||
}
|
||||
/* htup null so no buffer to release */
|
||||
/* get next offnum */
|
||||
if (offset < maxoff)
|
||||
offset = OffsetNumberNext(offset);
|
||||
|
||||
Reference in New Issue
Block a user