I am currently working on a Python-django project and use postgres for database support. I wish to turn off postgres config file variables, fsync
and full_pages_writes
so as to make migration files run faster for test database. Is there any way to do the same using circle.yml [circle config file]. Or any way to so this thing at all ?
Thanks for the question. You can use sed
in circle.yml
like so:
test:
pre:
- sudo sed -i 's/OLD/NEW/' /etc/postgresql/9.5/main/postgresql.conf
- sudo service postgresql restart
Thank you !! This was really helpful
@tom , is postgres not already optimised for fsync
, full_pages_writes
and other settings according to https://github.com/circleci/circle-env/blob/master/src/scripts/trusty/postgres.sh#L47 ?
Is not this script run to install postgres ?
How should one edit the postgres.conf file when using a circleci 2.0 config, with a separate container running Postgres?
Good question @jasonworden. You can probably pass sets of individual flags to the database binary, see here.
However, if you want to write a full config file, you’d probably need to create a custom image, see here. I’d create a separate repo and build process for that, and then pull in the new image in your current repo.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.