Re: [HACKERS] reverse file descriptor to a file name... - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] reverse file descriptor to a file name...
Date
Msg-id 199804102257.SAA06124@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] reverse file descriptor to a file name...  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
> 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)

pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] Linux/Alpha and pgsql....
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Linux/Alpha and pgsql....