heap_delete returns int now (for non-functional deletes).
This commit is contained in:
parent
ceac1d5a4e
commit
40ac5a692b
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.14 1997/08/19 21:29:17 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.15 1997/08/27 09:00:20 vadim Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
|
@ -1114,7 +1114,7 @@ heap_insert(Relation relation, HeapTuple tup)
|
||||||
* Must decide how to handle errors.
|
* Must decide how to handle errors.
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
int
|
||||||
heap_delete(Relation relation, ItemPointer tid)
|
heap_delete(Relation relation, ItemPointer tid)
|
||||||
{
|
{
|
||||||
ItemId lp;
|
ItemId lp;
|
||||||
|
@ -1163,7 +1163,7 @@ heap_delete(Relation relation, ItemPointer tid)
|
||||||
if ( IsSystemRelationName(RelationGetRelationName(relation)->data) )
|
if ( IsSystemRelationName(RelationGetRelationName(relation)->data) )
|
||||||
RelationUnsetLockForWrite(relation);
|
RelationUnsetLockForWrite(relation);
|
||||||
ReleaseBuffer(b);
|
ReleaseBuffer(b);
|
||||||
return;
|
return (1);
|
||||||
}
|
}
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* check that we're deleteing a valid item
|
* check that we're deleteing a valid item
|
||||||
|
@ -1203,6 +1203,8 @@ heap_delete(Relation relation, ItemPointer tid)
|
||||||
WriteBuffer(b);
|
WriteBuffer(b);
|
||||||
if ( IsSystemRelationName(RelationGetRelationName(relation)->data) )
|
if ( IsSystemRelationName(RelationGetRelationName(relation)->data) )
|
||||||
RelationUnsetLockForWrite(relation);
|
RelationUnsetLockForWrite(relation);
|
||||||
|
|
||||||
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
|
@ -1302,10 +1304,10 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple tup)
|
||||||
NowTimeQual,
|
NowTimeQual,
|
||||||
0,
|
0,
|
||||||
(ScanKey)NULL))
|
(ScanKey)NULL))
|
||||||
{
|
{
|
||||||
ReleaseBuffer(buffer);
|
ReleaseBuffer(buffer);
|
||||||
elog(WARN, "heap_replace: (am)invalid otid");
|
elog(WARN, "heap_replace: (am)invalid otid");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX order problems if not atomic assignment ??? */
|
/* XXX order problems if not atomic assignment ??? */
|
||||||
tup->t_oid = tp->t_oid;
|
tup->t_oid = tp->t_oid;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: heapam.h,v 1.8 1997/08/26 23:31:53 momjian Exp $
|
* $Id: heapam.h,v 1.9 1997/08/27 09:03:47 vadim Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -124,7 +124,7 @@ extern HeapTuple heap_getnext(HeapScanDesc scandesc, int backw, Buffer *b);
|
||||||
extern HeapTuple heap_fetch(Relation relation, TimeQual timeQual,
|
extern HeapTuple heap_fetch(Relation relation, TimeQual timeQual,
|
||||||
ItemPointer tid, Buffer *b);
|
ItemPointer tid, Buffer *b);
|
||||||
extern Oid heap_insert(Relation relation, HeapTuple tup);
|
extern Oid heap_insert(Relation relation, HeapTuple tup);
|
||||||
extern void heap_delete(Relation relation, ItemPointer tid);
|
extern int heap_delete(Relation relation, ItemPointer tid);
|
||||||
extern int heap_replace(Relation relation, ItemPointer otid,
|
extern int heap_replace(Relation relation, ItemPointer otid,
|
||||||
HeapTuple tup);
|
HeapTuple tup);
|
||||||
extern void heap_markpos(HeapScanDesc sdesc);
|
extern void heap_markpos(HeapScanDesc sdesc);
|
||||||
|
|
Loading…
Reference in New Issue