Need help with pg_tail?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

aaparmeggiani
107 Stars 4 Forks MIT License 29 Commits 1 Opened issues

Description

' tail -f ' your PostgreSQL tables.

Services available

!
?

Need anything else?

Contributors list

# 383,478
C
logging
Postgre...
php-pro...
23 commits
# 12,378
Arch Li...
Shell
fuzzyfi...
vimscri...
3 commits

pg_tail

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

Install

macOS

brew install aaparmeggiani/tap/pg_tail

generic Unix

PostgreSQL is needed and make sure yours have pgconfig and libpq. ```console git clone https://github.com/aaparmeggiani/pgtail.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 -W, --password prompts for the user password

-t, --table=TABLE           table to watch
-c, --columns=COL1..COLn    columns to watch, the first one must be an ordered primary key (sequence)
-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 database -t users -c id,login,email
id | login  | email              |
1  | system | [email protected] |
2  | global | [email protected] |
3  | teller | [email protected] |

Dockerized

Docker Build Status Image Info

docker run -it --init --rm aaparmeggiani/pg_tail -h host -d database -U user -t table -c key

(don't forget --init or you'll find yourself trapped without ctrl-c =)

License

MIT

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.