0

In Postgres I try to execute any query with LANGUAGE plpython3u like:

    CREATE OR REPLACE FUNCTION func(
    file_name character varying)
  RETURNS text AS
$BODY$
  return "aa"
$BODY$
  LANGUAGE plpython3u VOLATILE
  COST 100;

after that the server crashes with the following error:

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?

I looked in the Postgres logs for the following error:

Fatal Python error: initfsencoding: unable to load the file system codec ModuleNotFoundError: No module named 'encodings' Current thread 0x00001e44 (most recent call first): 2022-07-06 21:25:06.113 MSK [6000] СООБЩЕНИЕ: процесс сервера (PID 3592) был прерван исключением 0xC0000409

Googled on topics, did CREATE EXTENSION plpython3u; and set up environment variables, but nothing changes. I don’t understand what the problem is, Python 3.7 is installed (according to Postgres11 documentation)

0 Answers0