Re: Command line argument for Server

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Swapnil Bhoite <swapnil(dot)temp28(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Command line argument for Server
Date: 2014-03-24 13:41:36
Message-ID: 11942.1395668496@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Swapnil Bhoite <swapnil(dot)temp28(at)gmail(dot)com> writes:
> I want to set or reset a global flag.
> 1) What currently I'm thinking is, I'll declare that global flag in
> *postgres.h*
> 2) I'll set that depending on my custom flag given at server startup
> 3) I encountered function *getopt* but I couldn't understand it

> So my question is how should I process command line argument for server?
> Or is there any another way to do so using *postgresql.conf*?

Forget about inventing your own flag mechanism. Create a new GUC
parameter instead: there is lots and lots of existing infrastructure
you won't have to reinvent.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2014-03-24 14:03:12 Re: Dynamic background workers & docs question
Previous Message Swapnil Bhoite 2014-03-24 13:08:38 Command line argument for Server