+++ This bug was initially created as a clone of Bug #1123587 +++ Description of problem: Openshift overwrites data/postgresql.conf file resetting all changes made to that file, whenever the database service is restarted, that is, when pushing changes or manually restarting the service via rhc. Setting up datestyle and locale variables in the Locale and Formatting area is needed to run some applications correctly. Version-Release number of selected component (if applicable): Unknown How reproducible: Steps to Reproduce: 1. Create an application with a postgresql database. 2. Modify datestyle and locale vars in data/postgresql.conf. 3. Restart the application or the database service. Actual results: Overwriting of data/postgresql.conf file Expected results: No overwriting of data/postgresql.conf or making those values configurable via environment value so that the regenerated conf file will contain the desired value. Additional info: A related bug has been posted, referring the postgresql.conf file overwritting but focused on solving other variable set up at https://bugzilla.redhat.com/show_bug.cgi?id=1121727 A question has been opened on Stackoverflow: http://stackoverflow.com/questions/24955590/how-to-change-postgresql-conf-default-values-on-openshift --- Additional comment from Michal Fojtik on 2014-07-28 05:00:16 EDT --- Thanks for reporting this! I don't think customizing the data/postgresql.conf is something we want to support or encourage users to do. If you want to set the local vars, we should allow this via the specialized env variables, like: OPENSHIFT_POSTGRESQL_LOCALE="es_BO.utf8" I'm going to fix this and I will update the bug with the actual variable name. --- Additional comment from Michal Fojtik on 2014-07-28 05:41:21 EDT --- https://github.com/openshift/origin-server/pull/5664 --- Additional comment from openshift-github-bot on 2014-07-28 06:31:19 EDT --- Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/0cdd022f6316d7597f54620d2805f23b8e866315 Bug 1123587 - Added OPENSHIFT_POSTGRESQL_LOCALE environment variable
https://github.com/openshift/origin-server/pull/5682
http://etherpad.corp.redhat.com/puddle-2-2-2014-10-07
Verify this bug with openshift-origin-cartridge-postgresql-1.29.2-1.git.147.ef6cd67.el6op.noarch 1. Create a php app with postgresql-9.2 embedded, check its default settings in postgresql/data/postgresql.conf: datestyle = 'iso, mdy' lc_messages = 'en_US.utf8' lc_monetary = 'en_US.utf8' lc_numeric = 'en_US.utf8' lc_time = 'en_US.utf8' default_text_search_config = 'pg_catalog.english' 2. Set env vars to modify datestyle and locale vars rhc env-set OPENSHIFT_POSTGRESQL_LOCALE="zh_CN.utf8" -a app1 Setting environment variable(s) ... done rhc env-set OPENSHIFT_POSTGRESQL_DATESTYLE="iso, dmy" -a app1 Setting environment variable(s) ... done 3. Restart the postgres cartridge [root@dhcp-129-188 pei]# rhc cartridge restart postgresql-9 -a app1 Using postgresql-9.2 (PostgreSQL 9.2) for 'postgresql-9' Restarting postgresql-9.2 ... done 4. Check postgresql/data/postgresql.conf again. The env vars setting by user was taking effect datestyle = 'iso, dmy' lc_messages = 'zh_CN.utf8' lc_monetary = 'zh_CN.utf8' lc_numeric = 'zh_CN.utf8' lc_time = 'zh_CN.utf8' The two env vars also work well with scalable app and postgresql-8.4 cartridge.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2014-1796.html