On Feb 19, 2008 1:22 PM, Magnus Hagander <[EMAIL PROTECTED]> wrote: > I'd like to add a way for a client (in this case, typicallyi pgadmin, > phppgadmin or similar) to get the available options on the server for the > GUC settings we have that take fixed options. This is to make it possible > to generate pretty dropdown lists of the options. > > One way would be to simply pre-populate the client with the available > options. This sucks in at least two cases - the client has to be updated > whenever the server is. And, more importantly, in some cases the available > options depend on server-side build-time configuration (for example, > log_destination depends on win32/non win32 and syslog yes/no, wal_sync_method > depends on what's available on the OS). > > In order to somehow get this data down from the client, I see a couple of > ways: > > 1) Extend pg_settings with a column that contains an array of the available > options. Extend the config_string GUC struct with a hook that can return > this data. > > 2) Create a separate function, for the sake of argument > pg_get_available_options(<optionname>). Extend config_string GUC struct the > same way here. > > 3) Create one function for each of these, so a > pg_get_available_log_destinations(), pg_get_available_wal_sync_methods() > etc etc. > > 4) The best method available that I obviously didn't think of yet > > > Option 3 seems like an excessively ugly solution :) But what about the others? > What would people prefer?
I like option 1 the best. Minimally invasive, and probably easier to handle on the client than 2. 3 is just ugly as you say. You should be ashamed of yourself :-p -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com The Oracle-compatible database company ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly