### Connect to Server

Use this dialog to add a new server connection to the root of the pgAdmin tree.

If you're experiencing connection problems, check the connection problems page.

The description is a text to identify the server in the pgAdmin tree.

The host is the IP address of the machine to contact, or the fully qualified domain name. On Unix based systems the address field may be left blank to use the default PostgreSQL Unix Domain Socket on the local machine, or be set to an alternate path containing a PostgreSQL socket. If a path is entered, it must begin with a "/". The port number and SSL connection options may also be specified.

The maintenance DB field is used to specify the initial database that pgAdmin connects to, and that will be expected to have the pgAgent schema and adminpack objects installed (both optional). On PostgreSQL 8.1 and above, the maintenance DB is normally called 'postgres', and on earlier versions 'template1' is often used, though it is preferrable to create a 'postgres' database for this purpose to avoid cluttering the template database.

If you select "Store password", pgAdmin stores passwords you enter in the ~/.pgpass file under *nix or %APPDATA%\postgresql\pgpass.conf under Win32 for later reuse. For details, see pgpass documentation. It will be used for all libpq based tools. If you want the password removed, you can select the server's properties and uncheck the selection any time.

The "Restore env?" option determines whether or not pgAdmin will attempt to restore the browser environment when you reconnect to this server. If you regularly use different databases on the same server you might want to turn this option off.

The DB restriction field allows you to enter an SQL restriction that will be used against the pg_database table to limit the databases that you see. For example, you might enter: 'live_db', 'test_db' so that only live_db and test_db are shown in the pgAdmin browser. Note that you can also limit the schemas shown in the database from the Database properties dialogue by entering a restriction against pg_namespace.

The service field specifies parameters to control the database service process. Its meaning is operating system dependent.

If pgAdmin is running on a Windows machine, it can control the postmaster service if you have enough access rights. Enter the name of the service. In case of a remote server, it must be prepended by the machine name (e.g. PSE1\pgsql-8.0). pgAdmin will automatically discover services running on your local machine.

If pgAdmin is running on a Unix machine, it can control processes running on the local machine if you have enough access rights. Enter a full path and needed options to access the pg_ctl program. When executing service control functions, pgAdmin will append status/start/stop keywords to this. Example:
sudo /usr/local/pgsql/bin/pg_ctl -D /data/pgsql

You can unckeck the "Connect now" checkbox if you don't want the connection to the server being established immediately, but only registered for later use. In this case, the connection parameters won't be validated.

This dialog can be launched at a later time to correct or add parameters by executing "properties" when the server is selected.