checking my understanding of TupleDesc - Mailing list pgsql-hackers

From Chapman Flack
Subject checking my understanding of TupleDesc
Date
Msg-id 5D9148AC.3000600@anastigmatix.net
Whole thread Raw
Responses Re: checking my understanding of TupleDesc
List pgsql-hackers
From looking around the code, I've made these tentative observations
about TupleDescs:

1. If the TupleDesc was obtained straight from the relcache for some
   relation, then all of its attributes should have nonzero attrelid
   identifying that relation, but in (every? nearly every?) other case,
   the attributes found in a TupleDesc will have a dummy attrelid of zero.

2. The attributes in a TupleDesc will (always?) have consecutive attnum
   corresponding to their positions in the TupleDesc (and therefore
   redundant). A query, say, that projects out a subset of columns
   from a relation will not have a result TupleDesc with attributes
   still bearing their original attrelid and attnum; they'll have
   attrelid zero and consecutive renumbered attnum.

   Something like SendRowDescriptionCols_3 that wants the original table
   and attnum has to reconstruct them from the targetlist if available,

Have I mistaken any of that?

Thanks,
-Chap



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: JIT performance bug/regression & JIT EXPLAIN
Next
From: Michael Paquier
Date:
Subject: Re: pg_wal/RECOVERYHISTORY file remains after archive recovery