make temp postgres database
Project description
Installation
$ [sudo] pip install postgres-mktempdb
$ [sudo] npm i -g postgres-mktempdb
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for postgres-mktempdb-2020.12.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a3cbcbfafdb5ce0f3becb2a920654d28ffeb3b85c9660514abe0294d23ec0c4 |
|
MD5 | 055bb6304b4495ac1add88835ecfd03e |
|
BLAKE2b-256 | ea81a740875fce128ca83b686ddbb7decaadd0800e803ce41af31f4f316c27d5 |