I would like to use YAML in some plpython code, but YAML is not included in the python3 extension for PostgreSQL. My 'import yaml' gets an error that it cannot find yaml. On my regular Python3 install I did 'pip3 install yaml' which worked fine.
PyYAML is a YAML parser and emitter for Python. YAML is a data serialization format designed for human readability and interaction with scripting languages. Unicode support including UTF-8/UTF-16 input/output and * escape sequences. Download the file and run it to install setuptools. If you chose the X86-64 version in step 1, you must download ez_setup.py from the setuptools page to download and install.
How can I get yaml installed into PostgreSQL? Some more info for clarification: Here is the start of a function defined in PG: - Default audit trigger create or replace function sysaudit returns trigger language plpython3u AS $$ from sys import path path.append('/usr/local/lib/ez-python-library/PostgreSQL/bin'); from datetime import datetime from CommonRowFunctions import getPkValue, getRowValue, getRowChanges keyVal = ' modData = 'unknown'. The module 'CommonRowFunctions' tries to use YAML to configure logging. This module lives in my python library (external to PostgreSQL). This all works if I use a properties file for the log config, but using a dictionary is the preferred method and YAML makes that very easy. This is a problem specific to EnterpriseDB.
PostgreSQL does not ship Python, it merely ships a contrib module which your distribution is set to build against the system's Python. In the case of Windows, there is no Python for them to build against because there is no distribution. You can get any version of Python when you download 'python' (more properly cpython). So instead, EnterpriseDB bundles a version of Python they provide as a distribution of PostgreSQL. Previously, that were bundling a statically linked Active State Python, now they're bundling cPython 3.3 (which they can dynamically link in). This is all from.
To configure your system to use EnterpriseDB Python though, you need to first follow a few steps. From After installing Language Pack, you must set the following variables: set PYTHONHOME=C: edb languagepack-9.6 x64 Python-3.3 Use the following commands to add Python, Perl and Tcl to your search path: set PATH= C: edb LanguagePack-9.6 x64 Python-3.3 bin: C: edb LanguagePack-9.6 x64 Perl-5.20 bin: C: edb LanguagePack-9.6 x64 Tcl-8.5 bin:%PATH% After setting the system-specific steps required to configure Language Pack on Windows, restart the Advanced Server database server; see Section 5 for detailed information about restarting the server. There are After you configure that pip and easyinstall should work fine.