> You can't get a file name from a descriptor, because there can be more
> than one. The system just returns information about the inode, not
> about the directory entries pointing to the inode.
>
> For your purpose, you want:
>
> Relation->rd_rel->relname
>
> Works like champ.
>
> This is not a trivial question, because the structures in PostgreSQL are
> very complicated until you get used to them.
Speaking of this, I always considered this comment in
optimizer/plan/planner.c to be a classic:
/* reach right in there, why don't you? */
if (tletype != reln->rd_att->attrs[i - 1]->atttypid)
elog(ERROR, "function declared to return type %s does not retrieve (%s.all)", typeTypeName(typ),
typeTypeName(typ));
--
Bruce Momjian | 830 Blythe Avenue
maillist@candle.pha.pa.us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)