Grimoire-
Command
.es

GNU+Linux command memo

Kill long PostgreSQL request

database adminsys

Interrompre une requête PostgreSQL trop longue.

# ./manage.py dbshell (1)
DB_NAME=> SELECT * FROM pg_stat_activity WHERE state = 'active'; (2)
DB_NAME=> SELECT pg_cancel_backend(<pid of the process>); (3)
1 If you are working on a Django project, else check : here.
2 This will output a description of currently processed queries, their PID is the 3rd field.
3 This tries a gracefull stop, if it is still to long to stop try SELECT pg_terminate_backend(<pid of the process>);

Discorvered here : https://stackoverflow.com/a/35319598

Selection

  • Check SSD remaining lifetime
  • Save data from lost partition
  • Cipher external Android SDcard
  • Recommanded Firefox addons
  • doc_crawler.py : Extract site PDFs
  • 20 mémos "ligne de commande"
  • [Mémo 8] compression de fichiers
  • [Mémo 10] explorer le matériel
  • Tectonique de la pâte thermique
  • Doc. AsciiDoctor en français
  Articles | Command.es | Mémos

Themes  

  • Artix
  • Debian
  • Fairphone
  • Firefox
  • Git
  • JavaScript
  • KVM
  • Memo
  • Nim
  • Python
  • SSH
  • Tor
  • Xorg
  • adminsys
  • android
  • asciidoc
  • benchmark
  • bluetooth
  • code
  • comfort
  • compression
  • database
  • date
  • game
  • hardware
  • install
  • metadata
  • mount
  • music
  • mutt
  • network
  • optimization
  • optimize
  • regex
  • repair
  • security
  • shell
  • storage
  • vim

Sponsor

Meta-Press.es: search-engine

Liberapay   Patreon

Support via BTC 12z7pK5YFcmG7PGJ985dFtnRzwtxDVDmwc

A propos  Flux