--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. php项目,别人无法访问自己(windows 系统)上Apache服务器原因(转载)

    别人无法访问自己电脑上的Apache服务器,其中最大的原因是因为Windows防火墙的因素. 1.有安装防火墙的,把防火墙关闭 2.windows默认带防火墙的,进入 控制面板-系统和安全-Windo ...

  2. rails 杂记 - erb 中的 form_helper

    原文 1. form_tag 1) 基础 Form <%= form_tag do %> Form contents <% end %> 生成 html <form ac ...

  3. java学习之路--继承(子类构造器)

    子类的构造器不能访问父类的私有域,所以必须用的父类的构造器来对这部分的私有域进行初始化,我们可以通过super实现对父类的构造器的调用,使用super调用父类构造器的语句,必须放在子类构造器的第一句. ...

  4. ArcGIS AddIN 与ArcMap自带工具进行交互

    参考示例代码:C:\Program Files (x86)\ArcGIS\DeveloperKit10.1\Samples\ArcObjectsNet\Brushing 核心代码: //获取Selec ...

  5. 三、CSS语言

    CSS语言 1.概述:CSS (Cascading Style Sheets)是层叠样式表用来定义网页的显示效果.可以解决html代码对样式定义的重复,提高了后期样式代码的可维护性,并增强了网页的显示 ...

  6. thinkphp 百度地图Api坐标计算 A坐标距离B坐标多少公里 并按照距离近的排序 坐标排序 外部字段排序

    感谢我磊哥 函数封装方法: //计算距离 /* **$a 可多数坐标 就是可数组类型的 ***$b 是登录者的坐标 ***ps: lat经度 lng纬度 经度在前纬度在后 *** ***/ funct ...

  7. java中基本类型double和对象类型Double

    Double.valueOf(str)把String转化成Double类型的对象比如Stirng str="1.0";那么Double.valueOf(str)等价于new Dou ...

  8. python下载网页视频

    因网站不同需要修改. 下载 mp4 连接 from bs4 import BeautifulSoup import requests import urllib import re import js ...

  9. C#4.5-4.7学习总结

    4.5讲的是this关键字.它用于表示对当前实例的引用,它有三种用法,一是访问属性,解决与局部变量名称冲突问题,二是访问成员方法,在类中调用自己的成员方法,就是在一个方法中,通过this.方法名,调用 ...

  10. 使用Vivado初探ZedBoard的OLED驱动

    一.原理简介 Vivado版本:2016.2 OLED型号:128*32的UG-2832HSWEG04 ZedBoard的OLED部分电路原理图如下:(需要我们关心的是我用红色椭圆标注出来的3处,一共 ...