在编译plpytghon3u函数时,服务器在postgresql中意外关闭了连接

在编译plpytghon3u函数时,服务器在postgresql中意外关闭了连接,postgresql,psql,plpython,postgresql-10,postgres-plpython,Postgresql,Psql,Plpython,Postgresql 10,Postgres Plpython,在psql中定义PL/Python函数时,我遇到了错误: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. 职能: CREATE OR REPLACE FUNCTION pymax (a integer, b integer) RETURNS i

在psql中定义PL/Python函数时,我遇到了错误:

server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
职能:

CREATE OR REPLACE FUNCTION pymax (a integer, b integer) RETURNS integer AS
$$
    if a > b:
      return a
    return b
$$ LANGUAGE plpython3u;
PostgreSQL日志:

2018-01-16 17:17:57.296 IST [8164] LOG:  server process (PID 5128) was terminated by exception 0xC0000409
2018-01-16 17:17:57.296 IST [8164] DETAIL:  Failed process was running: CREATE OR REPLACE FUNCTION pymax (a integer, b integer) RETURNS integer AS
        $$
            if a > b:
              return a
            return b
        $$ LANGUAGE plpython3u;
2018-01-16 17:17:57.296 IST [8164] HINT:  See C include file "ntstatus.h" for a description of the hexadecimal value.
2018-01-16 17:17:57.296 IST [8164] LOG:  terminating any other active server processes
2018-01-16 17:17:57.300 IST [5484] WARNING:  terminating connection because of crash of another server process
2018-01-16 17:17:57.300 IST [5484] DETAIL:  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.
2018-01-16 17:17:57.300 IST [5484] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2018-01-16 17:17:57.324 IST [920] FATAL:  the database system is in recovery mode
2018-01-16 17:17:57.342 IST [8164] LOG:  all server processes terminated; reinitializing
2018-01-16 17:17:57.373 IST [5700] LOG:  database system was interrupted; last known up at 2018-01-16 17:17:41 IST
2018-01-16 17:17:57.993 IST [5700] LOG:  database system was not properly shut down; automatic recovery in progress
2018-01-16 17:17:58.022 IST [5700] LOG:  redo starts at 0/279BA58
2018-01-16 17:17:58.023 IST [5700] LOG:  invalid record length at 0/279BA90: wanted 24, got 0
2018-01-16 17:17:58.023 IST [5700] LOG:  redo done at 0/279BA58
2018-01-16 17:17:58.247 IST [8164] LOG:  database system is ready to accept connections

您应该告诉我们您是自己构建PostgreSQL还是安装了二进制发行版。如果是二进制的,您是从哪里下载PostgreSQL的?同样有趣的是,您安装了哪种Python以及它是从哪里获得的。从postgresql.org安装64位版本10,然后从这个包安装perl/Python/tcl语言包。postgresql.org不提供postgresql二进制文件。你得说得更具体些。你是从哪里得到Python的?我使用postgresql10.1.3 x64.exe从enterpriseDB站点安装postgresql,没有使用二进制文件来安装它,然后这个exe还提供了Python 3.4、perl 5.24和tcl inbuild语言包。