Sample Header Ad - 728x90

How to get YAML Python Library in PostgreSQL

1 vote
3 answers
978 views
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. How can I get yaml installed into PostgreSQL? Thanks. Some more info for clarification: Here is the start of a function defined in PG: -- Default audit trigger create or replace function sys_audit() 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.
Asked by Crashmeister (161 rep)
Mar 19, 2018, 03:43 PM
Last activity: Nov 12, 2020, 08:04 AM