Database Reference
In-Depth Information
pgAdmin Features
pgAdmin is chock full of goodies. We don't have the space to bring them all to light, so
we'll just highlight the features that we use on a regular basis.
Accessing psql from pgAdmin
Although pgAdmin is a great tool, psql does a better job in a few cases. One of them is
the execution of very large SQL files, such as those created by pg_dump and other dump
tools. You can easily jump to psql from pgAdmin. Click the plug-in menu, as shown in
Figure 4-3 , and then click PSQL Console. This opens a psql session connected to the
database you are currently connected to in pgAdmin. You can then use \cd and \i
commands to change directory and run the SQL file.
Figure 4-3. psql plug-in
Because this feature relies on a database connection, you'll see it disabled until you're
connected to a database.
Editing postgresql.conf and pg_hba.conf from pgAdmin
You can edit configuration files directly from pgAdmin provided that you installed the
adminpack extension on your server. PostgreSQL one-click installers generally create
the adminpack extension. You should see the menu enabled, as shown in Figure 4-4 .
Figure 4-4. PgAdmin configuration file editor
If the menu is grayed out and you are connected to a PostgreSQL server, either you don't
have the adminpack installed on that server or you are not logged in as a superuser. To
install the adminpack on a server running PostgreSQL 9.0 or earlier, connect to the
database named postgres as a superuser and run the file share/contrib/adminpack.sql .
For PostgreSQL 9.1 or later, connect to the database named postgres and run the SQL
statement CREATE EXTENSION adminpack; or use the graphical interface for installing
extensions, as shown in Figure 4-5 . Disconnect from the server and reconnect; you
should see the menu enabled.
 
Search WWH ::




Custom Search