Atualmente tenho apenas duas tabelas - uma pequena que funciona bem e outra presumivelmente grande. Quando tento descobrir a contagem de linhas no pgAdmin, recebo o seguinte erro:
The application has lost the database connection:
⁃ If the connection was idle it may have been forcibly disconnected.
⁃ The application server or database server may have been restarted.
⁃ The user session may have timed out.
Do you want to continue and establish a new session?
Também verifiquei os logs do servidor Postgres:
2020-03-30 03:06:06.764 MSK [37356] LOG: server process (PID 30712) was terminated by signal 9: Killed: 9
2020-03-30 03:06:06.764 MSK [37356] DETAIL: Failed process was running: SELECT COUNT(*)::text FROM ios.task_info;
2020-03-30 03:06:06.764 MSK [37356] LOG: terminating any other active server processes
2020-03-30 03:06:06.765 MSK [30810] WARNING: terminating connection because of crash of another server process
2020-03-30 03:06:06.765 MSK [30810] 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.
2020-03-30 03:06:06.765 MSK [30810] HINT: In a moment you should be able to reconnect to the database and repeat your command.
2020-03-30 03:06:06.765 MSK [30709] WARNING: terminating connection because of crash of another server process
2020-03-30 03:06:06.765 MSK [30709] 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.
2020-03-30 03:06:06.765 MSK [30709] HINT: In a moment you should be able to reconnect to the database and repeat your command.
2020-03-30 03:06:06.767 MSK [37356] LOG: all server processes terminated; reinitializing
2020-03-30 03:06:06.776 MSK [30816] LOG: database system was interrupted; last known up at 2020-03-30 02:51:14 MSK
2020-03-30 03:06:06.818 MSK [30817] FATAL: the database system is in recovery mode
2020-03-30 03:06:06.853 MSK [30816] LOG: database system was not properly shut down; automatic recovery in progress
2020-03-30 03:06:06.855 MSK [30816] LOG: redo starts at 0/4F4DE850
2020-03-30 03:06:06.855 MSK [30816] LOG: invalid record length at 0/4F4DE888: wanted 24, got 0
2020-03-30 03:06:06.855 MSK [30816] LOG: redo done at 0/4F4DE850
2020-03-30 03:06:06.862 MSK [37356] LOG: database system is ready to accept connections
Eu corro tudo no meu laptop OS X Catalina e uso o PostgreSQL 12 EnterpriseDB.
Apenas no caso de ser importante - criei a tabela grande enviando várias COPY
consultas CSV grandes no meu script Python. Qual pode ser o motivo desses erros?
Há um problema relacionado ao JIT nesta plataforma e versão que leva ao tipo de falha que você está relatando. É explicado nas listas de discussão:
Re: PG v12.2 - Definir jit_above_cost está causando o travamento do servidor
No momento, a solução parece ser
set jit = off
até que o EDB lance uma nova versão com uma correção, esperançosamente no PostgreSQL 12.3