GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
POSTGRESQL-RELAY(8) General Commands Manual POSTGRESQL-RELAY(8)

postgresql-relay - multiplex all your databases to one point of origin

postgresql-relay [options]

postgresql-relay can be used to as a single point of origin for all your databases. Instead of having to remember (or modify in case of changes) all the names of your databases, on which machines and on which ports they are running, you only need to remember one machine and the name of the database. The postgresql-relay will then forward the connection to the proper database on the proper port of the proper server. No more changes in the hundreds of clients and scripts!

Options are:

-c configurationfile
Use this configuration file instead of /usr/local/etc/postgresql-relay.conf.
-f
Stay in the foreground, don't daemonize. The logging will be printed to stdout too.
-q
Be quiet, don't log anything
-v
Be verbose, log a lot.

Each line in the configuration file has five fields, seperated by colons:

The first field is the incoming port for clients. For the easiest configuration on the client-side, keep this all the same (say port 5432 as the standard postgresql port).

The second field is the name of the database the client wants to connect to. This doesn't have to be the name of the database on the server connecting to.

The third field is the name of the host the database is located on.

The fourth field is the port the database is listening on.

The fifth field is the name of the database to connect to.

CONFIGURATION FILE EXAMPLES

Say you have two databases, one named mail on the local machine on port 5444 and one named users on the machine foo on port 5445. The configuration file would then be:

 5432:mail:localhost:5444:mail
 5432:users:foo:5445:users

With this configuration, Postgresql-relay will listen on port 5432 and forward connections to the mail and users databases.

Start the relay with a non-standard configuration file and keep it in the foreground:

 postgresql-relay -c /usr/local/etc/postgresql-relay.conf.test -f

Now, in a different terminal, connect to to mail database:

 psql -h dbserver -p 5432 -U root mail

postgresql-relay.conf, most likely in /usr/local/etc.

Postgresql-relay supports tcpwrappers. For access to postgresql-relay the daemon is called postgresql. For access to a database the daemon is called postgresql-dbname.

In the following example, the localhost and the hosts in the 10/8 network have access to postgresql-relay, while only the localhost and the 10.10.10.0/8 network have access to the database 'fdc':

 postgresql : 10.0.0.0/255.0.0.0 : allow
 postgresql : 127.0.0.1 : allow
 postgresql : ALL : deny

 postgresql-mail : 10.10.10.0/255.255.255.0 : deny 
 postgresql-mail : 127.0.0.1 : allow
 postgresql-mail : ALL : deny

Logging goes to syslog, to the facility daemon.

It would be best practise if the name of the machine on which postgresql-relay is running would have an alias in DNS, so that even if the machine on which postgresql-relay is running changes, the scripts don't have to be updated. A recommended name is dbrelay.

If the communication protocol version is unknown, it should fail properly but this hasn't been tested.

Edwin Groothuis, edwin@mavetju.org (http://www.mavetju.org)

psql(1)
November 22, 2004 November 22, 2004

Search for    or go to Top of page |  Section 8 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.