Re: how to understand these macro defines such as ObjectIdAttributeNumber in sysattr.h?

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: 土卜皿 <pengcz(dot)nwpu(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: how to understand these macro defines such as ObjectIdAttributeNumber in sysattr.h?
Date: 2014-08-18 07:57:46
Message-ID: CAB7nPqTGXLTH3JsCt7oypMQVRYpBDc62sEC-UyCNR4Lqs8rn9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 18, 2014 at 4:42 PM, 土卜皿 <pengcz(dot)nwpu(at)gmail(dot)com> wrote:
> Recently, for understanding postgresql's optimizer, I read and debug the
> source code. these two days, I read these macros in sysattr.h:
>
> ...
> #define ObjectIdAttributeNumber (-2)
> ...
>
> and the relative codes, but I still did not know why authors designed them
> like that, especially the value '-2' ?
>
> what should I do if I want to see the thoughts behind them? thanks in
> advance!
Those values define the system attribute IDs associated to a relation.
You can have a look at the top of heap.c to see where they come from,
particularly the fields FormData_pg_attribute a1..a7.
Hope this helps.
Regards,
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-08-18 08:05:25 Re: Index-only scans for GIST
Previous Message Michael Paquier 2014-08-18 07:51:49 Re: psql \watch versus \timing