#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    1
    Rep Power
    0

    How to add attributes to pg_class?


    hi,
    I want to add a new attribute to pg_class system table of PostgreSQL 9.2.3.
    I have modified all the things in pg_class.h, but when I run initdb, it throws error:

    E:\db\bin>initdb -D e:\db\data
    ...
    fixing permissions on existing directory e:/db/data ... ok
    creating subdirectories ... ok
    selecting default max_connections ... 100
    selecting default shared_buffers ... 32MB
    creating configuration files ... ok
    creating template1 database in e:/db/data/base/1 ... ok
    initializing pg_authid ... ok
    initializing dependencies ... ok
    creating system views ... ok
    loading system objects' descriptions ... ok
    creating collations ... not supported on this platform
    creating conversions ... ok
    creating dictionaries ... ok
    setting privileges on built-in objects ... FATAL: table row type and query-specified row type do not match
    DETAIL: Query has too few columns. attno: 27, resultDesc->natts: 28
    STATEMENT: UPDATE pg_class SET relacl = E'{"=r/\\"lee\\""}' WHERE relkind IN ('r', 'v', 'S') AND relacl IS NULL;

    child process exited with exit code 1
    initdb: removing contents of data directory "e:/db/data"

    In the last of ExecCheckPlanOutput,
    if (attno != resultDesc->natts)
    here attno is 27 and resultDesc->natts is 28.

    Is there anyone who can tell me how to solve this problem and
    are there other modifications except pg_class.h?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,785
    Rep Power
    348
    This is not the right forum for this kind of question.

    Please post this to the Postgres "hackers" mailing list: http://www.postgresql.org/community/lists/
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags.
    http://forums.devshed.com/misc.php?do=bbcode#code

    Tips on how to ask better questions:
    http://tkyte.blogspot.de/2005/06/how-to-ask-questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

IMN logo majestic logo threadwatch logo seochat tools logo