From: | Hao Lee <mixtrue(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Do we need use more meaningful variables to replace 0 in catalog head files? |
Date: | 2016-11-08 01:57:13 |
Message-ID: | CAGoxFiFeW64k4t95Ez2udXZmKA+tazUFAaSTtYQLM4Jhzw+-pg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi guys,
Although, usually, we do not change the system catalog or modify the
catalog schema, or adding a new system catalog, but in these system catalog
head files, such as pg_xxx.h, i think we should use more meaningful
variables. As we known, in pg_xxx.h files, we insert some initial values
into system catalog, as following shown in pg_class.h.
DATA(insert OID = 1247 ( pg_type PGNSP 71 0 PGUID 0 0 0 0 0 0 0 f f p r 30
0 t f f f f f f t n 3 1 _null_ _null_ ));
DESCR("");
DATA(insert OID = 1249 ( pg_attribute PGNSP 75 0 PGUID 0 0 0 0 0 0 0 f f p
r 21 0 f f f f f f f t n 3 1 _null_ _null_ ));
DESCR("");
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
Regards,
Hom.
From | Date | Subject | |
---|---|---|---|
Next Message | Kyotaro HORIGUCHI | 2016-11-08 02:02:58 | Re: Radix tree for character conversion |
Previous Message | Kyotaro HORIGUCHI | 2016-11-08 01:43:56 | Re: Radix tree for character conversion |