Re: [GENERAL] Fetching Server configured port from C Module

2013-04-17 Thread Mike Roest
Perfect thanks Bruce that worked. I just extern'd PostPortNumber in my module and everything seems to be working. --Mike

Re: [GENERAL] Fetching Server configured port from C Module

2013-04-17 Thread Bruce Momjian
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 r

Re: [GENERAL] Fetching Server configured port from C Module

2013-04-17 Thread Mike Roest
> 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.

Re: [GENERAL] Fetching Server configured port from C Module

2013-04-17 Thread John R Pierce
On 4/17/2013 12:08 PM, Mike Roest wrote: I could hard code the port in the module when we build it but it would be nice to be able to change the configured postgres port and not have to rebuild the module. Anyone have any suggestions? SHOW PORT; ? works in 9.2, anyways. -- john r pierc

Re: [GENERAL] Fetching Server configured port from C Module

2013-04-17 Thread Bruce Momjian
On Wed, Apr 17, 2013 at 01:08:18PM -0600, Mike Roest wrote: > Hi There, >I'm having a bit of an issue finding a C function to fetch the configured > server port from a C module. > > We have written a C module to allow for remote clients to call a function to > run pg_dump/pg_restore remotely b

[GENERAL] Fetching Server configured port from C Module

2013-04-17 Thread Mike Roest
Hi There, I'm having a bit of an issue finding a C function to fetch the configured server port from a C module. We have written a C module to allow for remote clients to call a function to run pg_dump/pg_restore remotely but create files locally on the db server. Currently it works fine if th