Re: Fetching Server configured port from C Module - Mailing list pgsql-general

From Bruce Momjian
Subject Re: Fetching Server configured port from C Module
Date
Msg-id 20130417194929.GK4602@momjian.us
Whole thread Raw
In response to Re: Fetching Server configured port from C Module  (Mike Roest <mike.roest@replicon.com>)
Responses Re: Fetching Server configured port from C Module
List pgsql-general
On Wed, Apr 17, 2013 at 01:32:00PM -0600, Mike Roest wrote:
>
>
>
>     SHOW PORT;
>
>  test=> SELECT setting FROM pg_settings WHERE name = 'port';
>          setting
>         ---------
>          5432
>
> Both of these are from a query context.  This is in a C module, I suppose I
> could run a query but there has to be a direct C function to get this data.

Well, you could look at how to access the PostPortNumber global
variable.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


pgsql-general by date:

Previous
From: Mike Roest
Date:
Subject: Re: Fetching Server configured port from C Module
Next
From: Scott Marlowe
Date:
Subject: Re: How large can a PostgreSQL database get?