Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
' tail -f ' your PostgreSQL tables.
C Makefile
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
Makefile
README.md
pg_tail.c

README.md

pg_tail

Watches last lines of a PostgreSQL table like in a "tail -f". Inspired by mysqltail.

Install

PostgreSQL is needed and make sure yours have pg_config and libpq.

git clone https://github.com/aaparmeggiani/pg_tail.git
cd pg_tail
make
make install

Usage

% pg_tail [OPTIONS] -t TABLE -c uKEY[,COL1,..,COLn]

Options:
    -d, --dbname=DBNAME           database to connect to
    -h, --host=HOSTNAME           database server host or socket directory
    -p, --port=PORT               database server port number
    -U, --username=NAME           connect as specified database user

    -t, --table=TABLE             table to watch
    -c, --columns=uKEY,COL1,COLn  columns to watch, the first one is an unique key
    -i, --interval=SECONDS        database polling interval in seconds (default: 10)
    -s, --separator=CHAR          sets a column delimiter (an no column alignment)
    -n  NUM                       number of lines in the first polling (default: 5)
    -v, --version                 version info

Example

% pg_tail -d mydatabase -t users -c id,login,email
id | login  | email                 |
1  | system | system@example.com    |
2  | global | global.xx@example.com |
3  | teller | teller.yy@example.com |

License

The MIT License (MIT)

Something went wrong with that request. Please try again.