Книга: Fedora™ Unleashed, 2008 edition

The PostgreSQL Command-Line Client

The PostgreSQL Command-Line Client

You invoke the PostgreSQL command-line client with the command psql. Like mysql, psql can be invoked with the name of the database to which you would like to connect. Also like mysql, psql can take several options. These options are listed in Table 18.2.

TABLE 18.2 Command-Line Options to Use When Invoking psql

Option Action
-h hostname Connects to the remote host hostname (if the database server isn't located on the local system).
-p n Specifies n as the number of the port to which the client should connect. Note that this is a lowercase p.
-U username Connects to the database as the user username.
-W Prompts for a password after connecting to the database. In PostgreSQL 7 and later, password prompting is automatic if the server requests a password after a connection has been established.
-? Displays a help message.

Several more options are available in addition to those listed in Table 18.2. See the psql's man page for details on all the available options.

Оглавление книги


Генерация: 1.294. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз