Re: Unify drop-by-OID functions

Ranier Vilela <ranier.vf@gmail.com>

From: Ranier Vilela <ranier.vf@gmail.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-05-05T23:21:55Z
Lists: pgsql-hackers
Only as a homework, is this function completely useless?

ItemPointerData
systable_scan_next(Relation heapRelation,
  Oid indexId,
  bool indexOK,
  Snapshot snapshot,
  int nkeys, ScanKey key)
{
    SysScanDesc scan;
HeapTuple htup;
ItemPointerData tid;

    scan = systable_beginscan(heapRelation, indexId, indexOK, snapshot,
nkeys, key);
htup = systable_getnext(scan);
if (HeapTupleIsValid(htup))
        tid = &htup->t_self;
else
        tid = NULL;
    systable_endscan(scan);

return tid;
}

regards,
Ranier Vilela

Commits

  1. Unify drop-by-OID functions