Re: Do we need use more meaningful variables to replace 0 in catalog head files?

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Do we need use more meaningful variables to replace 0 in catalog head files?
Дата
Msg-id CA+TgmobnxY3M7Rm+6aGkLF9Ry-p89Ly2LQFw_04Ga4gzr0a_5g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Do we need use more meaningful variables to replace 0 in catalog head files?  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: Do we need use more meaningful variables to replace 0 in catalog head files?
Re: Do we need use more meaningful variables to replace 0 in catalog head files?
Список pgsql-hackers
On Mon, Nov 7, 2016 at 9:10 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Tue, Nov 8, 2016 at 10:57 AM, Hao Lee <mixtrue@gmail.com> wrote:
>> It's a tedious work to figure out these numbers real meaning. for example,
>> if i want to know the value of '71'  represent what it is. I should go back
>> to refer to definition of pg_class struct. It's a tedious work and it's not
>> maintainable or readable.  I THINK WE SHOULD USE a meaningful variable
>> instead of '71'. For Example:
>>
>> #define PG_TYPE_RELTYPE 71
>
> You'd need to make genbki.pl smarter regarding the way to associate
> those variables with the defined variables, greatly increasing the
> amount of work it is doing as well as its maintenance (see for PGUID
> handling for example). I am not saying that this is undoable, just
> that the complexity may not be worth the potential readability gains.

Most of these files don't have that many entries, and they're not
modified that often.  The elephant in the room is pg_proc.h, which is
huge, frequently-modified, and hard to decipher.  But I think that's
going to need more surgery than just introducing named constants -
which would also have the downside of making the already-long lines
even longer.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Venkata B Nagothi
Дата:
Сообщение: Re: patch proposal
Следующее
От: Robert Haas
Дата:
Сообщение: Re: RV: Compilation warning on 9.5