* CatalogTupleUpdate - do heap and indexing work for updating a catalog tuple * * Update the tuple identified by "otid", replacing it with the data in "tup". * * This is a convenience routine for the common case of updating a single * tuple in a system catalog; it updates one heap tuple, keeping indexes * current. Avoid using it for multiple tuples, since opening the indexes * and building
| 299 | * (Use CatalogTupleUpdateWithInfo in such cases.) |
| 300 | */ |
| 301 | void |
| 302 | CatalogTupleUpdate(Relation heapRel, ItemPointer otid, HeapTuple tup) |
| 303 | { |
| 304 | CatalogIndexState indstate; |
| 305 | |
| 306 | CatalogTupleCheckConstraints(heapRel, tup); |
| 307 | |
| 308 | indstate = CatalogOpenIndexes(heapRel); |
| 309 | |
| 310 | simple_heap_update(heapRel, otid, tup); |
| 311 | |
| 312 | CatalogIndexInsert(indstate, tup); |
| 313 | CatalogCloseIndexes(indstate); |
| 314 | } |
| 315 | |
| 316 | /* |
| 317 | * CatalogTupleUpdateWithInfo - as above, but with caller-supplied index info |