Modification to the postgres catalog

From: "Carlos Chacon" <cdcarloschacon(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Modification to the postgres catalog
Date: 2006-10-11 16:29:33
Message-ID: 34ebda740610110929t315fa7dfs53c97b4425809bdc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

HI... im trying to modify the pg_class table by adding a new attribute. To
accomplish that, i modify the next archives:

- include/pg_class.h: in this file, i modfify:
FormData_pg_class struct: i add the new attribute, example a boolean...
.....
bool myNewAttribute; /*my new attribute */
aclitem relacl[1]; /* we declare this just for the
catalog */
}

then, i modify the macro "CLASS_TUPLE_SIZE":
#define CLASS_TUPLE_SIZE \
(offsetof(FormData_pg_class,relhassubclass) + sizeof(bool) +
sizeof(bool)) /* the last bool is my bool */

and then, i modify the DATA(insert ..)) of this file by adding a "t" just
before the "_null_" value...

- include/pg_attribute.h: i add to the macros and data the new attribute of
the pg_class table:
...
{ 1259, {"myNewAttribute"},16, -1, 1, 25, 0, -1, -1, true, 'p', 'c',
true, false, false, true, 0 }, \
{ 1259, {"relacl"}, 1034, -1, -1, 26, 1, -1, -1, false, 'x', 'i',
false, false, false, true, 0 } /* this is the macro */

....
DATA(insert ( 1259 relhassubclass 16 -1 1 24 0 -1 -1 t p c t f f t 0));
DATA(insert ( 1259 myNewAttribute 16 -1 1 25 0 -1 -1 t p c t f f t
0));
DATA(insert ( 1259 relacl 1034 -1 -1 26 1 -1 -1 f x i f f f t 0));
/* el data insert */

- utils/cache/relcache.c: in here, when the tables are initialized... i add
the next line of code:
rel->rd_rel->myNewAttribute = true;

then, i compile.... i everything goes well.... but when i execute the comand
"initdb -D ..." i always get next message:
initializing pg_authid ... ok
enabling unlimited row size for system tables ... ok
initializing dependencies ... ok
creating system views ... ok
loading pg_description ... ok
creating conversions ... ok
setting privileges on built-in objects ... FATAL: column "relacl" does not
exist
child process exited with exit code 1

I don't know what's going on???? Can anyone help me please?

thanks.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2006-10-11 16:40:42 Re: Index Tuning Features
Previous Message Sreejesh O S 2006-10-11 15:26:53 Re: Clarification needed