Re: Fetching Server configured port from C Module

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Mike Roest <mike(dot)roest(at)replicon(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Fetching Server configured port from C Module
Date: 2013-04-17 19:49:29
Message-ID: 20130417194929.GK4602@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2013-04-17 19:53:18 Re: How large can a PostgreSQL database get?
Previous Message Mike Roest 2013-04-17 19:32:00 Re: Fetching Server configured port from C Module