This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) In psql tool find the path to configuration file: | |
SHOW config_file; | |
2) In config: | |
shared_preload_libraries = 'pg_stat_statements' | |
3) After it restart the node via using `service postgresql restart` | |
4) In psql: | |
CREATE EXTENSION pg_stat_statements; | |
Queries: | |
SELECT pid,datname,usename,client_addr,query_start,query FROM pg_stat_activity; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copy this file into /bin folder of your virtual environment and let this this be executable | |
PYVER=3.6 | |
PYTHON=/usr/local/bin/python$PYVER | |
ENV=`$PYTHON -c "import os; print(os.path.abspath(os.path.join(os.path.dirname(\"$0\"), '..')))"` | |
export PYTHONHOME=$ENV | |
exec $PYTHON "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV=`python -c "import sys; print sys.prefix"` | |
PYTHON=`python -c "import sys; print sys.real_prefix"`/bin/python | |
export PYTHONHOME=$ENV | |
exec $PYTHON "$@" |