Excerpts from Tom Lane's message of mié jun 06 10:38:42 -0400 2012:
> Florian Pflug <fgp@phlo.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@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support