To list installed server libraries, execute the following SQL: show shared_preload_libraries. To configure
libraries to be preloaded, edit postgres.conf. On an Ubuntu apt installation, it would typically be found in
/etc/postgresql/9.0/main.

To see the default dynamic library search path, execute the following SQL: show dynamic_library_path

$libdir is configured during compile time. On an Ubuntu installation which is done using an Ubuntu package,
$libdir will typically point to /usr/lib/postgresql/9.0/lib. Plug-in library files should typically
be put in /usr/lib/postgresql/9.0/lib/plugins on an Ubuntu system.

To automatically create objects when a new database is created, create the objects in template1. (template0 is
barebone template from which template1 is created)

To install the PL/PGSQL debugger in an Ubuntu postgres server which has been installed using apt, you might want to do
a one-click install from Enterprise DB on a Linux VM
(see Enterprise DB downloads) and do the following:
Copy /opt/PostgreSQL/9.0/lib/postgresql/plugins/plugin_debugger.so to $libdir/plugins on the Ubuntu installation.
Copy /opt/PostgreSQL/9.0/lib/postgresql/pldbgapi.so to $libdir on the Ubuntu installation.
Copy /opt/PostgreSQL/9.0/lib/postgresql/targetinfo.so to $libdir on the Ubuntu installation.
Copy /opt/PostgreSQL/9.0/share/postgresql/contrib/pldbgapi.sql to /usr/share/postgresql/9.0/contrib. on the Ubuntu installation.
Now edit postgres.conf and change the following setting:
shared_preload_libraries = ‘$libdir/plugins/plugin_debugger.so’
Now restart the postgres server and apply
You can also download the latest version of edb-debugger from
PgFoundry
and compile it to get plugin_debugger.so and pldbgapi.sql.