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
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.
https://github.com/openshift/origin-server/pull/5664
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
Thank for the quick response. I see that now i can configure local vars via env variables, but the datestyle is missing, would you please allow to change this var too, this variable is important to run some applications with other date styles like mine, for example i need to change: datestyle = 'iso, mdy' to datestyle = 'iso, dmy' or my application won't work.
Checked on devenv_5020, the local vars can be configured via env variable, but the datestyle var still can be overwritten when restarting, so assign it back. For configuring local vars teting results: 1. Create an app with postgresql rhc app create cas jbossas-7 postgresql-9 --no-git 2. Set the env var rhc env-set OPENSHIFT_POSTGRESQL_LOCALE="zh_CN.utf8" -a cas 3. SSH into the app and check the local vars in ~/postgresqldata/postgresql.conf Results: the values take effect at step 2.
I have made a mistake in the testing results steps in Comment 5, the mistake is i have restarted the postgresql between step 2 and step 3, but missed pasting the restarted step, sorry for any confused and please refer to the below total testing steps: For configuring local vars teting results: 1. Create an app with postgresql rhc app create cas jbossas-7 postgresql-9 --no-git 2. Set the env var for postgresql rhc env-set OPENSHIFT_POSTGRESQL_LOCALE="zh_CN.utf8" -a cas 3. Restart postgresql database rhc cartridge restart postgresql-9 -a cas 4. SSH into the app and check the local vars in ~/postgresqldata/postgresql.conf Results: the values take effect at step 2.
Should be fixed here: https://github.com/openshift/origin-server/pull/5682 There is a new ENV variable: OPENSHIFT_POSTGRESQL_DATESTYLE as the format is not the same as locale.
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/d73cdebe4d5af47431991ca94e8481af2740c790 Bug 1123587 - Added OPENSHIFT_POSTGRESQL_DATESTYLE env var
Checked on devenv_5039, the OPENSHIFT_POSTGRESQL_DATESTYLE var settings have taken effect for postgresql 9.2, but not for postgresql-8.4; from the PR, the changed codes only for postgresql 9.2, please help to have a look.
Chunchen: Good catch! I'm sorry about that, I completely overseen the 8.2 configuration file. PR: https://github.com/openshift/origin-server/pull/5687
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/91f2cffaed7a508764c009fc587c8e5b43061767 Bug 1123587 - Updated postgresql-8.2 to support OPENSHIFT_POSTGRESQL_DATESTYLE
It's fixed, verified on devenv_5041, the OPENSHIFT_POSTGRESQL_DATESTYLE var also takes effect for postgresql-8.4 for now, so mark it as VERIFIED.
Looks like this shipped with Sprint 50, any reason it isn't Closed?