Re: [PATCHES] PostgreSQL virtual hosting support

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "David J(dot) MacKenzie" <djm(at)web(dot)us(dot)uu(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] PostgreSQL virtual hosting support
Date: 2000-07-11 20:39:56
Message-ID: Pine.LNX.4.21.0007110049040.28566-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

David J. MacKenzie writes:

Greetings,

These sound like interesting features, but you need to start with the
current sources. The options handling in particular has changed, look in
src/backend/utils/misc/guc.c.

> 4. The ability to, if run as root, open a pid file in /var/run as
> root, and then setuid to the desired user. (mysqld -u can almost
> do this; I had to patch it, too).

I've been wondering about this too. If we could set the user name in the
configuration file then this would certainly make the installation
procedures a lot simpler. Actually, initdb could use such an option as
well. Maybe this would work:

if test `pg_id -u` -eq 0 ; then
su -l "$user" "$0 $*"
exit
fi

where $user is the value of the --user/-u option.

> 1. Adds an environment variable PGUNIXSOCKET, analogous to MYSQL_UNIX_PORT,
> and command line options -k --unix-socket to the relevant programs.

Here's the trick question, what does this do: `psql -k foo -h bar'?
Perhaps we can integrate this into the -h option:

psql -h /tmp/foo => Unix socket
psql -h tmp.foo => TCP/IP
psql -h foo => TCP/IP
psql -h ./foo => Unix socket

That way we don't have to add a new option everywhere. Just an idea.

> 2. Adds a -h option to postmaster to set the hostname or IP address to
> listen on instead of the default INADDR_ANY.

That sounds like something that needs to be added into guc.c. You'll be
the first to add a string option, so it probably won't work. :)

--
Peter Eisentraut Sernanders väg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2000-07-11 20:44:05 Re: Foreign key bugs + other problems
Previous Message Peter Eisentraut 2000-07-11 20:38:33 Re: pg_backup symlink?

Browse pgsql-patches by date

  From Date Subject
Next Message Zeugswetter Andreas SB 2000-07-12 16:37:53 minor patch for AIX
Previous Message Karel Zak 2000-07-11 15:08:18 Re: MemoryContextCheck()