The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Pgtools::pg_kill - kill the postgresql processes with option

SYNOPSIS

    pg_kill shows the specified queries during execution by regular expression and other options.
    And also kill these specifid queries by -kill option.

  Options:
    -db  database:       set the database name
    -h   host:           host (localhost)
    -help:               show this help
    -ignore_match_query: except matching query
    -ignore_match_state: except matching state
    -kill:               kill query which matched condition
    -mq  match_query:    query match
    -ms  match_state:    state match
    -pr  print:          print killed queries info
    -p   passward:       set password
    -port:               port number
    -r   run_time:       execute time 
    -u   user:           Postgres user name 
    -v   version:        version

    (Example)

    Print option just shows matched query.

    $ pg_kill -print -mq '.*' "192.168.32.12,5432,postgres,,dvdrental"
    -------------------------------
    pid       : 11493
    start_time: 2016-03-20 16:11:17.57228+00
    state     : idle
    query     : SELECT * FROM actor WHERE last_name like '%a%';
    -------------------------------
    pid       : 11492
    start_time: 2016-03-20 16:08:07.762289+00
    state     : idle
    query     : select * from actor where actor_id < 200;


    You can kill the matched query with -kill option.
    Be careful to kill queries!!
    Please test on your environments. And exec this in your responsibility.

    $ pg_kill -kill -print -mq "like\s'\%.*\%'" "192.168.32.12,5432,postgres,,dvdrental"
    -------------------------------
    Killed-pid: 11590
    At        : 2016/03/21 01:32:29
    Query     : SELECT * FROM actor WHERE last_name like '%a%';
    Killed matched queries!

AUTHOR

Tomoaki Otsuka, <otsuka.tt at gmail.com>

BUGS

Please report any bugs or feature requests to the Github page.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Pgtools::pg_kill

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2016 Tomoaki Otsuka.

This program is free software;