postgresql:terminate hung query
--Find the PID by running this sql:
SELECT pid , query, * from pg_stat_activity
WHERE state != 'idle' ORDER BY xact_start; --You'll find the pid in the first (left) column, and the first (top) row is likely to be the query you'd like to terminate.
--I'll assume the pid is 1234 below.
--You may cancel a query through SQL (i.e. without shell access) as long as it's yours or you have super user access:
select pg_cancel_backend(1960); --This is the "soft" way ... the query won't disappear immediately. If you're in a hurry, try this one instead:
select pg_terminate_backend(1960); --If you have shell access and root or postgres permissions you can also do it from the shell:
kill -INT 1234 --If that doesn't help, use:
kill 1234
postgresql:terminate hung query的更多相关文章
- 解决postgresql -- ERROR: 42601: query has no destination for result data
I am learning Npgsql and PostgreSQL. I am unable to define the output parameter correctly. What am I ...
- Understanding postgresql.conf : log*
After loooong pause, adding next (well, second) post to the “series“. This time, I'd like to describ ...
- Spark SQL访问PostgreSQL
随着Spark SQL的正式发布,以及它对DataFrame的支持,它可能会取代HIVE成为越来越重要的针对结构型数据进行分析的平台.在博客文章What’s new for Spark SQL in ...
- PostgreSQL数据库资料(转)
PostgreSQL数据库资料 转自:http://blog.csdn.net/postgrechina/article/details/49132791 推荐书籍: 概念书籍: <Postgr ...
- 打造基于 PostgreSQL/openGauss 的分布式数据库解决方案
在 MySQL ShardingSphere-Proxy 逐渐成熟并被广泛采用的同时,ShardingSphere 团队也在 PostgreSQL ShardingSphere-Proxy 上持续发力 ...
- Metasploit辅助模块
msf > show auxiliary Auxiliary ========= Name Di ...
- pg 资料大全1
https://github.com/ty4z2008/Qix/blob/master/pg.md?from=timeline&isappinstalled=0 PostgreSQL(数据库) ...
- 17--Box2D使用(三、触摸交互)
Box2D引擎与触摸的交互通过创建鼠标关节以及碰撞检测来得到触摸点下面的刚体,在根据触摸操作完成相应的功能.首先添加触摸响应函数声明 virtual void ccTouchesBegan(cocos ...
- cocos2d之Box2D详细说明 鼠标联合实现
cocos2d之Box2D具体解释 鼠标关节实现 DionysosLai2014-5-7 我们常常要移动物理世界中的某个物体,例如说石头.木块等.假设我们直接改变这些物体的位置,让这些物体尾随我们手指 ...
随机推荐
- vim 命令补充(1)
本篇文章主要教你如何使用 Vim 分屏功能. 分屏启动Vim 使用大写的O参数来垂直分屏. vim -On file1 file2 ... 使用小写的o参数来水平分屏. vim -on file1 f ...
- Installing Ruby 2.2 on Centos7
准备做redis-cluster,需要ruby2.2环境 开整环境:Centos7.2最小安装yum源:阿里的base和epel源 ********************************** ...
- 关于ie浏览器信任站点的代码
1检测用户当前浏览器是否将域名的ip添加信任站点 js代码 //域名ip的获取 var hostname = window.location.hostname; var WshShell ...
- 使用强类型DataSet增加数据并获取自动增长的ID
使用强类型的DataSet可以方便的操作数据库:有时候我们会对表的ID设置为自动增长,并且需要在插入数据后获取新插入数据的ID,按以下方法即可达到目的: 一. 首先建立一个表,id为自动增加, ...
- try 和 catch 和 finally
try块中出现异常走进catch,异常后面的代码不会再被执行:finally块里try和catch执行完后要执行的代码,且一定会执行. 在释放资源的时候,不要多个放在一个try块里面. 流的关闭顺序: ...
- linux文件系统变为只读解决
linux控制台显示文件系统变为只读,需输密码或者按ctrl+d结束 输入root密码后执行fsck -y /dev/sda1,fsck -y /dev/sda2和fsck -y /dev/sda3等 ...
- PrimeNG之DataTable
--数据表显示在表格格式数据. Basic Import import {DataTableModule,SharedModule} from 'primeng/primeng'; source &l ...
- 编写Shell脚本的最佳实践
编写Shell脚本的最佳实践 http://kb.cnblogs.com/page/574767/ 需要记住的 代码有注释 #!/bin/bash # Written by steven # Name ...
- js 合并两个数组对象
项目背景是合并a = [{name:'dede'},{name:'jenny'}], b = [{age:18},{age:19}] 合并成[{name:'dede',age:18},{name: ...
- Mac系统下 PHP7安装Swoole扩展 教程
转载自 https://www.fujieace.com/php/php-extensions/swoole.html 今天我用的PHP版本是:PHP7.1 环境依赖: php-5.3.10 或更高版 ...