Adding new variables into GUC

From: Θάνος Παπαπέτρου <thanos(at)di(dot)uoa(dot)gr>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Adding new variables into GUC
Date: 2011-02-10 15:23:12
Message-ID: DF7173AF-073A-4E59-A861-A416C43CC030@di.uoa.gr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I am an MSc student in the department of Informatics and
Telecommunications of the University of Athens and as part of my
thesis I am examining a new path/plan cost model for DB optimizers. I
have successfully changed the optimizer of PostgreSQL in order to
implement this model, but I have stumbled upon a very little detail:
until now I use some hardcoded values in my code which I would like to
make accessible through GUC. After much googling the only relative
pages I have found are about configuring existing PostgreSQL variables
and src/backend/utils/misc/README does not mention anything about
adding new vars. Can anybody please provide some help?

I presume I have to add new entries in ConfigureNames* arrays in src/
backend/utils/misc/guc.c, but I am not sure about the field values of
config_* structs I have to enter. Also is there any "standard"
location where the actual variables should be declared, or I can
freely declare them in any source file (the source file that actually
uses them)? Do I have to declare a config_generic struct too? How do I
specify boot values?

Thanks in advance,

Thanos Papapetrou

Θάνος Παπαπέτρου

You insist that there is something that a machine can't do. If you
will tell me precisely what it is that a machine cannot do, then I can
always make a machine which will do just that.

P.S.: I initially posted this message in pgsql-generic, but after
thinking about it more I believe this is the most appropriate list, so
I re-posted here.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-02-10 15:32:31 Re: log_hostname and pg_stat_activity
Previous Message Steve Singer 2011-02-10 15:22:53 Re: log_hostname and pg_stat_activity