【发布时间】:2016-07-07 13:56:26
【问题描述】:
SQL 命令在 postgres 中只卡在一张表上
我在使用 postgres 数据库的 django 项目中工作。
SQL 查询适用于所有表,但不适用于 common_designprofilecontent 表
工作:
reader=# SELECT COUNT(*) FROM common_document;
count
-------
20046
(1 row)
不工作:
reader=# SELECT COUNT(*) FROM common_designprofilecontent;
此查询没有结果,此表中至少存在 20046 * 4 行。
执行以下操作后:
reader=# select * from pg_stat_activity;
5:30 | 2016-03-21 10:22:27.240863+05:30 | 2016-03-21 10:22:28.614431+05:30 | t | SELECT "common_designprofilecontent"."id", "common_designprofil
econtent"."page_id", "common_designprofilecontent"."doc_id", "common_designprofilecontent"."profilename", "common_designprofilecontent"."profileconten
t", "common_designprofilecontent"."page_rev_no", "common_designprofilecontent"."createdDate", "common_designprofilecontent"."createdAgent_id", "common
_designprofilecontent"."modifiedDate", "common_designprofilecontent"."modifiedAgent_id" FROM "common_designprofilecontent" WHERE "common_designprofile
content"."doc_id" = 26952
16440 | reader | 28783 | 10 | postgres | vacuumdb | | | -1 | 2016-03-19 23:37:15.579589+0
5:30 | 2016-03-19 23:37:15.581737+05:30 | 2016-03-19 23:37:15.581737+05:30 | t | VACUUM (FULL, ANALYZE);
+
日志文件/var/log/pgsql中也没有任何内容
【问题讨论】:
-
没有结果是什么意思?绞刑?只是空结果?并且由于某种原因有一个完全真空运行,这可能会阻塞一些东西。
-
如果你重启 postgres 你能重现这个问题吗?
-
@SamiKuhmonen:挂了..我不知道真空。
-
@spicyramen:我重新启动了 postgres,但还是同样的问题。
-
请关闭这个问题。在 SO 上徘徊的“不知道如何”问题毫无意义。
标签: mysql django postgresql