Skip site navigation (1) Skip section navigation (2)

Re: Ability to listen on two unix sockets

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Florian Pflug <fgp(at)phlo(dot)org>, Honza Horak <hhorak(at)redhat(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Ability to listen on two unix sockets
Date: 2012-06-06 14:50:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Excerpts from Tom Lane's message of mié jun 06 10:38:42 -0400 2012:
> Florian Pflug <fgp(at)phlo(dot)org> writes:
> > Couldn't you simply tell postgres to put it's socket in, say, /var/run, and create a symlink to that socket in the global /tmp directory?
> FYI, this proposal emerged out of a discussion between Honza and
> myself.  "Use a symlink" was my first idea too, but on reflection
> it seems like it will take less new code to support two sockets.
> We already support multiple TCP sockets, so multiple Unix sockets
> shouldn't be that much extra trouble.
> The reasons a symlink doesn't seem attractive are:
> 1. The code to create/delete it has to be in the postmaster.  If we
> tried to make the Fedora-specific startup script manage it, we would
> first have to teach that script how to know which port number the
> postmaster will select, which means parsing config files.  Ugh.

Well, you could use
postmaster -C port

The other reason seems compelling enough, though ... particularly,
handling a lockfile sounds messy; if it's a symlink and it's created by
the script, then it would need a separate lockfile, and filling its data
wouldn't be exactly trivial.

> (BTW, we would probably just adopt the Debian solution if we were
> sure there were no non-libpq clients out there; but we aren't.)

Maybe this is a good time to make the /var/run socket location (Debian's
choice) the primary one, and /tmp be the alternate.

Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to


pgsql-hackers by date

Next:From: Honza HorakDate: 2012-06-06 15:21:00
Subject: Re: Ability to listen on two unix sockets
Previous:From: Andres FreundDate: 2012-06-06 14:50:02
Subject: Re: Ability to listen on two unix sockets

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group