--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. arch 将 普通用户添加到 docker 组

    如果还没有 docker group 就添加一个: sudo groupadd docker 如果你想用你的使用者帳戶(非root帳戶)來使用Docker,把你的帳戶加到Docker的群組中 sudo ...

  2. html table 固定表头和列

    /**************************************************************** jQuery 插件. 功能: 固定表格标题行或列头 Version: ...

  3. MySQL的一些操作(学习记录_备忘)

    有个问题一直困扰着我,就是在windows下,使用命令行登录mymql时,得cd进mysql的\bin目录下.但我已经将mysql的\bin加入了环境变量,似乎不起作用. mysql 不允许创建表名全 ...

  4. MySQL常用运算符:算术运算符、比较运算符、逻辑运算符

    (一)  算术运算符 注意: 在除法运算和模运算中,如果除数为0,将是非法除数,返回结果为NULL. div运算符主要是求两个数相除的商 (二)  比较运算符:比较运算符的运算结果为1(条件为真),0 ...

  5. 部署WEB项目到服务器(三)安装mysql到linux服务器(Ubuntu)详解

    突发奇想,想在自己电脑上部署一个web网站. 1,首先是下载一个适合自己已安装服务器版本的mysql数据库. 这里使用网上的链接http://dev.mysql.com/downloads/mysql ...

  6. SpringCloud微服务高级

    分布式配置中心 什么是配置中心 在分布式系统中,由于服务数量巨多,为了方便服务配置文件统一管理,实时更新,所以需要分布式配置中心组件.在Spring Cloud中,有分布式配置中心组件spring c ...

  7. Spark共享变量(广播变量、累加器)

    转载自:https://blog.csdn.net/Android_xue/article/details/79780463 Spark两种共享变量:广播变量(broadcast variable)与 ...

  8. [svc]unix和cpu发展历史

    最近搞汇编 , 有一款8086cpu,16bit, 支持内存1M 于是勾起了对计算机历史的兴趣,多了解了下 unix起源历史 [Unix发展历史 - 程序猿-贝岩博客 - CSDN博客]https:/ ...

  9. 分布式异步任务Celery

    -A代表APP celery -A tasks worker --loglevel=info -n nodemaster -------------- celery@nodemaster v4.1.0 ...

  10. Asp.net Core认证和授权:JWT认证和授权

    JWT验证一般用户移动端,因为它不像cookie验证那样,没有授权跳转到登陆页面 JWT是json web token的简称,在  jwt.io 网址可以看到 新建一个API项目,通过postman ...