plpython

Is there any recipe to successfully install PLPython in Postgresql 9.3 64bit or 32bit on Windows 64 bits?

自古美人都是妖i 提交于 2019-12-23 09:48:22
问题 running CREATE EXTENSION plpython3u give me the error: The specified module could not be found. even if the file is at the correct place. After reading everything on the web, I tried to download another python version (3.2) as suggested and replace the dll... Now I receive an error about a missing magic block: missing magic block HINT: Extension libraries are required to use the PG_MODULE_MAGIC macro. I tried the sames processes with a 32 and 64 bits version of Postgresql and both failed like

What is the correct way to load a dll library in Postgres PL/Python?

与世无争的帅哥 提交于 2019-12-20 05:25:09
问题 The following gives an error drop function testing(); CREATE FUNCTION testing() RETURNS text AS $$ import ctypes try: ctypes.windll.LoadLibrary("D:\\jcc.dll") except: import traceback plpy.error(traceback.format_exc()) return '' $$ LANGUAGE plpythonu; select testing(); Error message: ERROR: ('Traceback (most recent call last):\n File "<string>", line 5, in __plpython_procedure_testing_1517640\n File "D:\\Python26\\Lib\\ctypes\\__init__.py", line 431, in LoadLibrary\n return self._dlltype(name

could not load library plpython3.dll

不羁岁月 提交于 2019-12-20 01:46:51
问题 i am getting error while creating extension in Postgresql version 10 could not load library "C:/Program Files/PostgreSQL/10/lib/plpython3.dll": The specified module could not be found CREATE EXTENSION plpython3u; could not load library "C:/Program Files/PostgreSQL/10/lib/plpython3.dll": The specified module could not be found Using Postgresql 10 on Window 10 回答1: I have struggled a lot with this. For me only worked when I installed the right version of python and added paths to environment

could not load library plpython3.dll

余生长醉 提交于 2019-12-20 01:46:00
问题 i am getting error while creating extension in Postgresql version 10 could not load library "C:/Program Files/PostgreSQL/10/lib/plpython3.dll": The specified module could not be found CREATE EXTENSION plpython3u; could not load library "C:/Program Files/PostgreSQL/10/lib/plpython3.dll": The specified module could not be found Using Postgresql 10 on Window 10 回答1: I have struggled a lot with this. For me only worked when I installed the right version of python and added paths to environment

how to change Python version used by plpython on Mac OSX?

非 Y 不嫁゛ 提交于 2019-12-14 02:19:54
问题 I have installed PostgreSQL 9.0.4 on Mac OSX 10.6 using the installer from EnterpriseDB and noticed that stored procedures implemented in plpython use python 2.5. A look into the plpython library seems to confirm that (otool sort of does on the mac what ldd does on linux): host:~ user$ otool -L /Library/PostgreSQL/9.0/lib/postgresql/plpython2.so /Library/PostgreSQL/9.0/lib/postgresql/plpython2.so: /System/Library/Frameworks/Python.framework/Versions/2.5/Python (compatibility version 2.5.0,

Install plpython3u for PostgreSQL 9.5 on CentOS 7.2

安稳与你 提交于 2019-12-12 15:06:52
问题 Try as I might, I have not succeeded in installing the plpython3u extension on a PostgreSQL 9.5 x64 install. PostgreSQL 9.5 installed from pgdg repo: [joe@postgresql ~]$ yum list installed | grep pgdg CGAL.x86_64 4.7-1.rhel7 @pgdg95 SFCGAL.x86_64 1.2.2-1.rhel7 @pgdg95 SFCGAL-libs.x86_64 1.2.2-1.rhel7 @pgdg95 geos.x86_64 3.5.0-1.rhel7 @pgdg95 pgdg-centos95.noarch 9.5-2 installed plv8_95.x86_64 1.4.4-1.rhel7 @pgdg95 postgis2_95.x86_64 2.2.2-1.rhel7 @pgdg95 postgis2_95-client.x86_64 2.2.2-1

Using PL/Pythonu with virtualenv

∥☆過路亽.° 提交于 2019-12-11 01:36:45
问题 I am writing function in postgres in python using the PL/Pythonu extension in postgres. I would like postgres to use my virutal environment (I am using virtualenv) instead of the global install. How do I go about doing this? 回答1: As it turns out, one must add the path to where the libraries are found to the PYTHONPATH environment variable in postgres. Don't forget to quote your value eg: PYTHONPATH='path to libraries' 回答2: Answered over at https://stackoverflow.com/a/24892335/5430 tl;dr -

Unable to install postgres with python3 support on mac

南楼画角 提交于 2019-12-10 17:54:41
问题 Both postgres and python3 are already installed on my High Sierra system - so the following was attempted: brew upgrade postgres --with-python I had thought that the --with-python would have installed just the postgres plpython3u language support . However it tried to [re]install python itself. /usr/local/Cellar/sqlite/3.26.0: 11 files, 3.7MB ==> Installing postgresql dependency: python ==> Downloading https://homebrew.bintray.com/bottles/python-3.7.2.high_sierra.bottle.tar.gz ###############

How to install PL/Python on PostgreSQL 9.3 x64 Windows 7?

寵の児 提交于 2019-12-07 03:50:46
问题 I have tried to install the PL/Python v2.x language inside PostgreSQL on my database running the query: CREATE EXTENSION plpythonu; (I got this from http://www.postgresql.org/docs/9.3/static/plpython.html) But I'm getting this error: ERRO: não pôde acessar arquivo "$libdir/plpython2": No such file or directory ********** Error ********** ERRO: não pôde acessar arquivo "$libdir/plpython2": No such file or directory SQL state: 58P01 How to install this in an automated way? I need to install it

Reusing pure Python functions between PL/Python functions

核能气质少年 提交于 2019-12-06 02:12:08
问题 I would like to declare and share some simple, pure python functions between two or more PL/Python functions. I am using Postgres 9.3. For example, I have: CREATE OR REPLACE FUNCTION get_mod(modifier varchar) RETURNS varchar AS $$ def is_float(val): try: if val: float(val) return True else: return False except ValueError: return False if modifier is None: return "NOMOD" if is_float(modifier): return str(float(modifier)*1) return modifier $$ LANGUAGE plpythonu; I would like to use function is