Thread: MacOSX and pg_service

MacOSX and pg_service

From
Tim Uckun
Date:
I recently switched from ubuntu to a mac and pgadmin does not seem to
be obeying my pg_service params. Specifically I am suffering from
horrible disconnection problems. I had the disconnection problems with
ubuntu as well until I upgraded to 1.14 and started using .pg_service
file.

Does pgadmin look for .pg_service in the same place (~/.pg_service) if
not where. If so why am I constantly losing connection?


Re: MacOSX and pg_service

From
Guillaume Lelarge
Date:
On Wed, 2012-01-25 at 12:41 +1300, Tim Uckun wrote:
> I recently switched from ubuntu to a mac and pgadmin does not seem to
> be obeying my pg_service params. Specifically I am suffering from
> horrible disconnection problems. I had the disconnection problems with
> ubuntu as well until I upgraded to 1.14 and started using .pg_service
> file.
> 
> Does pgadmin look for .pg_service in the same place (~/.pg_service) if
> not where. If so why am I constantly losing connection?
> 

pg_service is only used when connecting. It has nothing to do with
losing connections. Or did I misunderstood something in you mail?


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org



Re: MacOSX and pg_service

From
Tim Uckun
Date:
> pg_service is only used when connecting. It has nothing to do with
> losing connections. Or did I misunderstood something in you mail?
>


When I was having problems with connections dropping out I was advised
to use a pg_service because it sets up keepalives and such like this

keepalives=1
keepalives_idle=10
keepalives_interval=10

This did seem to help when I told pgadmin to use the service it didn't
drop the connections anymore.


Re: MacOSX and pg_service

From
Guillaume Lelarge
Date:
On Thu, 2012-01-26 at 09:50 +1300, Tim Uckun wrote:
> > pg_service is only used when connecting. It has nothing to do with
> > losing connections. Or did I misunderstood something in you mail?
> >
> 
> 
> When I was having problems with connections dropping out I was advised
> to use a pg_service because it sets up keepalives and such like this
> 
> keepalives=1
> keepalives_idle=10
> keepalives_interval=10
> 
> This did seem to help when I told pgadmin to use the service it didn't
> drop the connections anymore.
> 

Well, that explains why you use a service. But, actually, if you are
able to connect with pgAdmin to PostgreSQL using the service, then the
service configuration is OK. It doesn't explain the disconnection you
seem to have now that you're using Mac OS X.

With the informations you told us, I can only conclude that the problem
is not pgAdmin or the pg_service file, but Mac OS X.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org



Re: MacOSX and pg_service

From
Tim Uckun
Date:
> With the informations you told us, I can only conclude that the problem
> is not pgAdmin or the pg_service file, but Mac OS X.

You may be right.  I was not having this problem with Linux.


Re: MacOSX and pg_service

From
Herouth Maoz
Date:
On 26/01/2012, at 01:33, Tim Uckun wrote:

>> With the informations you told us, I can only conclude that the problem
>> is not pgAdmin or the pg_service file, but Mac OS X.
>
> You may be right.  I was not having this problem with Linux.

You may have the same problem that I have - that when MacOS falls asleep, it truly doesn't allow any activity,
includingnetwork activity, and thus the connection is not kept alive. I see this with all my interfaces to PostgreSQL
(whichresides on a different machine on the same network), not just pgAdmin. They all require reconnect after the Mac
hasbeen sleeping. 

Linux machines tend not to be set up to sleep at all (at least my desktop Linuxes never fully sleep, just have their
monitorssleep), and thus you may not have the same problem on your Linux. 

I still wish it would be easier to reconnect after a connection is dropped in pgAdmin.

Herouth