--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的更多相关文章

  1. 解决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 ...

  2. Understanding postgresql.conf : log*

    After loooong pause, adding next (well, second) post to the “series“. This time, I'd like to describ ...

  3. Spark SQL访问PostgreSQL

    随着Spark SQL的正式发布,以及它对DataFrame的支持,它可能会取代HIVE成为越来越重要的针对结构型数据进行分析的平台.在博客文章What’s new for Spark SQL in ...

  4. PostgreSQL数据库资料(转)

    PostgreSQL数据库资料 转自:http://blog.csdn.net/postgrechina/article/details/49132791 推荐书籍: 概念书籍: <Postgr ...

  5. 打造基于 PostgreSQL/openGauss 的分布式数据库解决方案

    在 MySQL ShardingSphere-Proxy 逐渐成熟并被广泛采用的同时,ShardingSphere 团队也在 PostgreSQL ShardingSphere-Proxy 上持续发力 ...

  6. Metasploit辅助模块

    msf > show auxiliary Auxiliary ========= Name                                                  Di ...

  7. pg 资料大全1

    https://github.com/ty4z2008/Qix/blob/master/pg.md?from=timeline&isappinstalled=0 PostgreSQL(数据库) ...

  8. 17--Box2D使用(三、触摸交互)

    Box2D引擎与触摸的交互通过创建鼠标关节以及碰撞检测来得到触摸点下面的刚体,在根据触摸操作完成相应的功能.首先添加触摸响应函数声明 virtual void ccTouchesBegan(cocos ...

  9. cocos2d之Box2D详细说明 鼠标联合实现

    cocos2d之Box2D具体解释 鼠标关节实现 DionysosLai2014-5-7 我们常常要移动物理世界中的某个物体,例如说石头.木块等.假设我们直接改变这些物体的位置,让这些物体尾随我们手指 ...

随机推荐

  1. 更改ORACLE归档路径及归档模式

    更改ORACLE归档路径及归档模式   在ORACLE10g和11g版本,ORACLE默认的日志归档路径为闪回恢复区($ORACLE_BASE/flash_recovery_area).对于这个路径, ...

  2. 12.vue属性.监听.组件

    1.计算属性 https://cn.vuejs.org/v2/guide/computed.html new Vue({ computed:{//定义 show(){ } } }) ++计算属性1.h ...

  3. vue3版本到vue2版本的桥接工具

    vue2的命令可以正常使用.

  4. 前端自动化构建工具webpack (二)之css和插件加载总结

    1.  webpack只识别js文件,其他文件都需要转换成js文件.所有文件都是模块; 2. css解析      css需要css-loader  --->style-loader ----- ...

  5. Scrapy框架基本使用

    pycharm+Scrapy 距离上次使用Scrapy已经是大半年前的事情了,赶紧把西瓜皮捡回来.. 简单粗暴上爬取目标: 初始URL:http://quotes.toscrape.com/ 目标:将 ...

  6. [Database.System.Concepts(6th.Edition.2010)].Abraham.Silberschatz. Ch8学习笔记

    Database Ch8.relational design 8.1 features of good design 8.1.1 larger alternatives why design is g ...

  7. Golang覆盖写入文件的小坑

    记录一点Golang文件操作的笔记,环境:Ubuntu // 删除文件 func removeFile() { err := os.Remove("test.txt") if er ...

  8. GIS优秀博客以及网址收藏,持续更新

    1.gislaozhang arcpy,模型构建器,arcpro 地址:https://blog.csdn.net/gislaozhang?t=1      2.雾语 arcpy,模型构建器,arcg ...

  9. IntelliJ IDEA java文件注释模板

    一.设置 二.注释模板 /*** @version: java version 1.7+* @Author : * @Explain :* @contact: * @Time : ${DATE} ${ ...

  10. Excel编辑栏字体显示大小

    文件-> 选项-> 常规与保存-> 标准字体-> 确定 关闭文件,重启生效