From 9d744d71e386e29ee7df13e8044e3b59dafc0190 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Tue, 16 Dec 2014 23:42:53 +0000 Subject: [PATCH] Put pg into pg-8 compat mode for sqlalchemy with binary content --- roles/postgresql_server/templates/postgresql.conf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/postgresql_server/templates/postgresql.conf b/roles/postgresql_server/templates/postgresql.conf index e8c058b99a..5f9314c62e 100644 --- a/roles/postgresql_server/templates/postgresql.conf +++ b/roles/postgresql_server/templates/postgresql.conf @@ -1,3 +1,10 @@ +{% if ansible_hostname.startswith("db-fas01") %} +# This enabled pg-8 compatibility for bytea fields +# Fixes errors with sqlalchemy with binary data when app is on RHEL6 and server is PG9 +# Reference: https://bitbucket.org/zzzeek/sqlalchemy/issue/2016/pickletype-does-not-work-with-postgresql +bytea_output = 'escape' +{% endif %} + # ----------------------------- # PostgreSQL configuration file # -----------------------------