-
Notifications
You must be signed in to change notification settings - Fork 0
/
DEVNOTES
30 lines (20 loc) · 729 Bytes
/
DEVNOTES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Attach to a running instance:
1. Figure out the PID, e.g:
$ ps x
[…]
30837 pts/1 S+ 0:00 python3 produce/main.py 8082
[…]
2. Attach another server on a different port, when code-testing:
$ </proc/30837/environ xargs -0 mksh -c 'exec env "$@" ./run-produce.sh 8083' --
# or (new)
$ ./devattach.sh ./run-produce.sh 8083
3. Attach a PostgreSQL client:
$ </proc/30837/environ xargs -0o mksh -c 'exec env "$@" psql' --
# or (new)
$ ./devattach.sh
4. If needed, enable statement logging:
postgres=# ALTER SYSTEM SET log_statement TO 'all';
postgres=# SELECT pg_reload_conf();
$ tail -F /tmp/pg_virtualenv.*/log/postgresql-*-regress.log
5. Enter the session
postgres=# SELECT jensjs.use_session(1);