我使用mongo_fdw 在PG 里面查询mongodb 数据,单独执行操作语句没问题,do $ declare begin ....end $$ 里面执行
select into var_x count(1) as count from "来自mongodb 的映射表" where xx=yy;
的时候,PG 就挂了(recovering 状态),实际上我在mongodb 里面的那张表只有200多条数据记录;PG 单独select * from from_mongodb_map_table; 没有问题的。
do $$ declare begin end$$ 代码,见插入的图片,只要执行到这里PG 就挂了。。
查看了一下PG日志:
2016-04-13 11:57:54.702 CST 18502 570b7c87.4846 1102 2016-04-11 18:29:27 CST 0 LOG 0 server process (PID 18582) was terminated by signal 6: Aborted "Failed process was running: /*
1?????????=?????????????????????????????????????????????????????????????????????????????????????????????
2????????????=???????????????/????????????*100%???
3???????????????????????????????????????????????????---????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
4??????????????????[0-24]????????????????????????????????????
5???????????????????????????????????????????????????????????????
6??????????????????????????????????????????????????????????????????
7????????????????????????????????????????????????????????????????????????????????????
8???????????????????????????????????????????????????????????????????????????/????????????????????????*100%;
9???V??????????????????V??????????????????????????????????????????
""title"" (
""??????"" character varying,
""?????????"" character varying,
"
2016-04-13 11:57:54.702 CST 18502 570b7c87.4846 1103 2016-04-11 18:29:27 CST 0 LOG 0 terminating any other active server processes
2016-04-13 11:57:54.702 CST postgres truckno1_20151116 12490 10.169.9.115:54231 570dc318.30ca 3 idle 2016-04-13 11:55:04 CST 11/0 0 WARNING 57P02 terminating connection because of crash of another server process The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. In a moment you should be able to reconnect to the database and repeat your command.
2016-04-13 11:57:54.702 CST readonly truckno1_20151116 8767 10.51.24.164:46535 570d9c59.223f 3 idle 2016-04-13 09:09:45 CST 12/0 0 WARNING 57P02 terminating connection because of crash of another server process The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. In a moment you should be able to reconnect to the database and repeat your command.
2016-04-13 11:57:54.702 CST postgres postgres 18580 10.168.105.140:53498 570b7d45.4894 3 idle 2016-04-11 18:32:37 CST 3/0 0 WARNING 57P02 terminating connection because of crash of another server process The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. In a moment you should be able to reconnect to the database and repeat your command. pgAdmin III - ?????????
2016-04-13 11:57:54.702 CST readonly truckno1_20151116 18974 10.51.24.164:52460 570b8234.4a1e 3 idle 2016-04-11 18:53:40 CST 2/0 0 WARNING 57P02 terminating connection because of crash of another server process The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. In a moment you should be able to reconnect to the database and repeat your command.
2016-04-13 11:57:54.702 CST 18514 570b7c87.4852 2 2016-04-11 18:29:27 CST 1/0 0 WARNING 57P02 terminating connection because of crash of another server process The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. In a moment you should be able to reconnect to the database and repeat your command.
2016-04-13 11:57:54.702 CST readonly truckno1_20151116 18975 10.51.24.164:52462 570b8234.4a1f 3 idle 2016-04-11 18:53:40 CST 6/0 0 WARNING 57P02 terminating connection because of crash of another server process The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. In a moment you should be able to reconnect to the database and repeat your command.
2016-04-13 11:57:54.702 CST postgres truckno1_20151116 11816 10.168.105.140:56272 570dbaa8.2e28 3 idle 2016-04-13 11:19:04 CST 4/0 0 WARNING 57P02 terminating connection because of crash of another server process The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. In a moment you should be able to reconnect to the database and repeat your command. pgAdmin III - ?????????
2016-04-13 11:57:54.703 CST readonly truckno1_20151116 8789 10.51.24.164:46572 570d9c6e.2255 3 idle 2016-04-13 09:10:06 CST 15/0 0 WARNING 57P02 terminating connection because of crash of another server process The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. In a moment you should be able to reconnect to the database and repeat your command.
2016-04-13 11:57:54.703 CST readonly truckno1_20151116 7370 10.51.24.164:34108 570c4f4b.1cca 3 idle 2016-04-12 09:28:43 CST 7/0 0 WARNING 57P02 terminating connection because of crash of another server process The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. In a moment you should be able to reconnect to the database and repeat your command.
2016-04-13 11:57:54.704 CST postgres truckno1_20151116 14081 10.168.105.140:62479 570c92e3.3701 6 idle 2016-04-12 14:17:07 CST 8/0 0 WARNING 57P02 terminating connection because of crash of another server process The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. In a moment you should be able to reconnect to the database and repeat your command. pgAdmin III - ????????????
2016-04-13 11:57:55.058 CST 18502 570b7c87.4846 1104 2016-04-11 18:29:27 CST 0 LOG 0 all server processes terminated; reinitializing
2016-04-13 11:57:56.787 CST 12528 570dc3c4.30f0 1 2016-04-13 11:57:56 CST 0 LOG 0 database system was interrupted; last known up at 2016-04-13 10:58:49 CST
2016-04-13 11:58:01.596 CST 12528 570dc3c4.30f0 2 2016-04-13 11:57:56 CST 0 LOG 0 database system was not properly shut down; automatic recovery in progress
2016-04-13 11:58:01.607 CST 12528 570dc3c4.30f0 3 2016-04-13 11:57:56 CST 0 LOG 0 redo starts at 3EA/D6B31E20
2016-04-13 11:58:25.203 CST 18502 570b7c87.4846 1105 2016-04-11 18:29:27 CST 0 LOG 0 "setsockopt(TCP_KEEPIDLE) failed: 鏃犳晥鐨勫弬鏁?,,,,,,,,,""
2016-04-13 11:58:25.204 CST,,,12545,"",570dc3e1.3101,1,"",2016-04-13 11:58:25 CST,,0,LOG,00000,connection received: host=10.168.105.140 port=56646"""
2016-04-13 11:58:25.214 CST postgres truckno1_20151116 12545 10.168.105.140:56646 570dc3e1.3101 2 2016-04-13 11:58:25 CST 0 FATAL 57P03 the database system is in recovery mode
2016-04-13 11:58:28.625 CST 18502 570b7c87.4846 1106 2016-04-11 18:29:27 CST 0 LOG 0 "setsockopt(TCP_KEEPIDLE) failed: 鏃犳晥鐨勫弬鏁?,,,,,,,,,""
2016-04-13 11:58:28.625 CST,,,12546,"",570dc3e4.3102,1,"",2016-04-13 11:58:28 CST,,0,LOG,00000,connection received: host=10.168.105.140 port=56647"""
2016-04-13 11:58:28.625 CST postgres truckno1_20151116 12546 10.168.105.140:56647 570dc3e4.3102 2 2016-04-13 11:58:28 CST 0 FATAL 57P03 the database system is in recovery mode
2016-04-13 11:58:57.218 CST 18502 570b7c87.4846 1107 2016-04-11 18:29:27 CST 0 LOG 0 "setsockopt(TCP_KEEPIDLE) failed: 鏃犳晥鐨勫弬鏁?,,,,,,,,,""
2016-04-13 11:58:57.219 CST,,,12547,"",570dc401.3103,1,"",2016-04-13 11:58:57 CST,,0,LOG,00000,connection received: host=10.168.105.140 port=56656"""
2016-04-13 11:58:57.221 CST postgres postgres 12547 10.168.105.140:56656 570dc401.3103 2 2016-04-13 11:58:57 CST 0 FATAL 57P03 the database system is in recovery mode
2016-04-13 11:58:57.225 CST 18502 570b7c87.4846 1108 2016-04-11 18:29:27 CST 0 LOG 0 "setsockopt(TCP_KEEPIDLE) failed: 鏃犳晥鐨勫弬鏁?,,,,,,,,,""
2016-04-13 11:58:57.226 CST,,,12548,"",570dc401.3104,1,"",2016-04-13 11:58:57 CST,,0,LOG,00000,connection received: host=10.168.105.140 port=56657"""
记录有多大? 看看是不是被OOM了?
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。