Skip to content
Guillaume Lelarge edited this page Apr 4, 2016 · 5 revisions

pgsnap is a PostgreSQL tool that mimics orasnap performance report tool for Oracle.

It's written in PHP but one uses it on the command line. Many HTML files, aka reports, are written on a folder. You only need a web browser to read the complete report.

Demos

Here is an example of the output:

Download

Install

To install pgsnap, you can untar the pgsnap tarball anywhere you want.

You'll need the CLI release of PHP. For example, on Debian/Ubuntu, you should have:

apt-get install php5-pgsql php5-cli

Usage

./pgsnap [OPTIONS]... [DBNAME]

General options

  • -a, --all, build a report for all databases on the PostgreSQL server
  • -d DBNAME, specify database name to connect to (default: your login name)
  • -o outputdir, specify directory name where the reports will be created (default: the database name followed by 'snap_', followed by the date and time)
  • -S, --without-sysobjects, get report without system objects informations
  • --delete-if-exists, delete output directory if it already exists
  • --help, show this help, then exit
  • --version, output version information, then exit

Connection options

  • -h HOSTNAME, database server host or socket directory (default: "localhost")
  • -p PORT, database server port (default: "5432")
  • -U NAME, database user name (default: your login name)
  • -W, prompt for password
  • -w, do NOT prompt for password

Clone this wiki locally