Re: How to control which Python interpreter Postgres uses?

Поиск
Список
Период
Сортировка
От Wells Oliver
Тема Re: How to control which Python interpreter Postgres uses?
Дата
Msg-id CAOC+FBWQTA5hfTEg16+kVGkQ2oO-CDr4Ma9Ny8wQe=ZuEieEQA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to control which Python interpreter Postgres uses?  (Ni Ne <nineoften@hotmail.com>)
Ответы Re: How to control which Python interpreter Postgres uses?  (Ni Ne <nineoften@hotmail.com>)
Re: How to control which Python interpreter Postgres uses?  (Ilya Anfimov <ilan@tzirechnoy.com>)
Список pgsql-admin
Apologies if I'm misunderstanding, but you can specify a virtual env (so any interpreter) as we did here:

CREATE FUNCTION slack (msg text)
    RETURNS boolean
AS $$
    hook = 'https://...'
    activate_this = '/opt/python/env/bin/activate_this.py'
    exec(open(activate_this).read(), dict(__file__=activate_this))
    from slack_sdk.webhook import WebhookClient
    import ssl
    ssl_context = ssl.create_default_context()
    ssl_context.check_hostname = False
    ssl_context.verify_mode = ssl.CERT_NONE
    webhook = WebhookClient(hook, ssl=ssl_context)
    webhook.send(text=msg)
    return True
$$ LANGUAGE plpython3u;




On Mon, Nov 1, 2021 at 3:06 PM Ni Ne <nineoften@hotmail.com> wrote:
Would I recompile the plpython package or postgres itself?


From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Monday, November 1, 2021 4:03 PM
To: Ni Ne <nineoften@hotmail.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: How to control which Python interpreter Postgres uses?
 
Ni Ne <nineoften@hotmail.com> writes:
> How can I adjust my postgres settings to tell it which Python interpreter binary to use?

You'd have to recompile plpython against the particular libpython
you want to use.

                        regards, tom lane


--

В списке pgsql-admin по дате отправления:

Предыдущее
От: Ni Ne
Дата:
Сообщение: Re: How to control which Python interpreter Postgres uses?
Следующее
От: Ni Ne
Дата:
Сообщение: Re: How to control which Python interpreter Postgres uses?