summaryrefslogtreecommitdiff
path: root/src/backend/storage/large_object/inv_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/large_object/inv_api.c')
-rw-r--r--src/backend/storage/large_object/inv_api.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/backend/storage/large_object/inv_api.c b/src/backend/storage/large_object/inv_api.c
index 0e279eed3d..5279190000 100644
--- a/src/backend/storage/large_object/inv_api.c
+++ b/src/backend/storage/large_object/inv_api.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.93 2002/06/20 20:29:35 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.94 2002/08/05 03:29:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -404,8 +404,7 @@ inv_write(LargeObjectDesc *obj_desc, char *buf, int nbytes)
Datum values[Natts_pg_largeobject];
char nulls[Natts_pg_largeobject];
char replace[Natts_pg_largeobject];
- bool write_indices;
- Relation idescs[Num_pg_largeobject_indices];
+ CatalogIndexState indstate;
Assert(PointerIsValid(obj_desc));
Assert(buf != NULL);
@@ -413,11 +412,7 @@ inv_write(LargeObjectDesc *obj_desc, char *buf, int nbytes)
if (nbytes <= 0)
return 0;
- write_indices = !IsIgnoringSystemIndexes();
- if (write_indices)
- CatalogOpenIndices(Num_pg_largeobject_indices,
- Name_pg_largeobject_indices,
- idescs);
+ indstate = CatalogOpenIndexes(obj_desc->heap_r);
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
@@ -511,9 +506,7 @@ inv_write(LargeObjectDesc *obj_desc, char *buf, int nbytes)
newtup = heap_modifytuple(oldtuple, obj_desc->heap_r,
values, nulls, replace);
simple_heap_update(obj_desc->heap_r, &newtup->t_self, newtup);
- if (write_indices)
- CatalogIndexInsert(idescs, Num_pg_largeobject_indices,
- obj_desc->heap_r, newtup);
+ CatalogIndexInsert(indstate, newtup);
heap_freetuple(newtup);
/*
@@ -556,9 +549,7 @@ inv_write(LargeObjectDesc *obj_desc, char *buf, int nbytes)
values[Anum_pg_largeobject_data - 1] = PointerGetDatum(&workbuf);
newtup = heap_formtuple(obj_desc->heap_r->rd_att, values, nulls);
simple_heap_insert(obj_desc->heap_r, newtup);
- if (write_indices)
- CatalogIndexInsert(idescs, Num_pg_largeobject_indices,
- obj_desc->heap_r, newtup);
+ CatalogIndexInsert(indstate, newtup);
heap_freetuple(newtup);
}
pageno++;
@@ -566,8 +557,7 @@ inv_write(LargeObjectDesc *obj_desc, char *buf, int nbytes)
index_endscan(sd);
- if (write_indices)
- CatalogCloseIndices(Num_pg_largeobject_indices, idescs);
+ CatalogCloseIndexes(indstate);
/*
* Advance command counter so that my tuple updates will be seen by