postgres-mktempdb

2019.5.23 • Public • Published

make temp postgres database

Installation

$ [sudo] npm i -g postgres-mktempdb

Scripts usage

command usage
mktempdb usage: mktempdb [OPTION]...

Examples

$ mktempdb
tmp_LH8LqXy8UGlfMR8zfB3todrc4mwC9Sns

delete temp databases:

$ psql -At -c "SELECT datname FROM pg_database WHERE datname LIKE 'tmp_%'" | xargs -L 1 dropdb

delete temp databases created more than 5 minutes ago:

$ psql -At -c "SELECT datname FROM pg_database
WHERE datname LIKE 'tmp_%' AND (pg_stat_file('base/'||oid||'/PG_VERSION')).modification<now()+interval '5 minutes'" | xargs -L 1 dropdb

python-readme-generator

/postgres-mktempdb/

    Package Sidebar

    Install

    npm i postgres-mktempdb

    Weekly Downloads

    2

    Version

    2019.5.23

    License

    Unlicense

    Unpacked Size

    1.6 kB

    Total Files

    3

    Last publish

    Collaborators

    • russianidiot
    • andrewp-as-is