Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (33 sloc) 1.62 KB
log_functions Install
=====================
To install log_functions, you should untar the log_functions tarball
anywhere you want.
You'll need to compile it. There are two ways to do that, depending on your
PostgreSQL release:
* PostgreSQL older than 9.2
* go into your PostgreSQL source code directory
* go into the contrib sub-directory
* put the log_functions source directory inside the contrib sub-directory of PostgreSQL
* do "make", then "make install"
* PostgreSQL 9.2 and newer
* do "make USE_PGXS=1", then "make USE_PGXS=1 install"
You can also compile log_functions on Windows. You'll need to use the
build.bat script, that you will find in the src/tools/msvc directory of the
PostgreSQL source code directory.
Once it's installed, you'll need to configure PostgreSQL to make use of it:
* shared_preload_libraries = 'log_functions'
* custom_variable_classes = 'log_functions' (for PostgreSQL 9.1 and older)
There are five optional parameters that allow you to select which logs you want:
* log_functions.log_declare
* log_functions.log_function_begin
* log_functions.log_function_end
* log_functions.log_statement_begin
* log_functions.log_statement_end
By default, only log_functions.log_statement_begin, and
log_functions.log_statement_begin are off. The other parameters are on.
Once the configuration is done, restart PostgreSQL.
You can also decide to use it only from time to time. If you want to do that,
you don't need to configure PostgreSQL. When you want to use it, simply execute
the following SQL statement:
LOAD 'log_functions';
Then, you will be able to set the five optional parameters.