Skip to content

Conversation

@matthewfranglen
Copy link

This allows additional settings to be loaded from /etc/postgres/postgresql.conf as part of the docker command which launches any container based on 9.5, 9.4, 9.3 or 9.2. This file is optional.

PostgreSQL version 9.1 and 9.0 do not support include_if_exists so they have not been updated. It may be possible to add this feature to them by providing a blank file which can be replaced.

I have tested that the databases created by these docker containers launch, perform simple queries, and have settings which can be updated by loading files.

I was able to load a change with the following command:

docker run docker run [OPTIONS] -v [FILE]:/etc/postgres/postgresql.conf [IMAGE DETAILS]

I tested it by increasing the work_mem setting.

…tion

This allows the default settings file to be supplemented with additional
settings. It is possible to replace all settings in this way, so a
complete configuration file can be used.

This needs to be tested.
This allows the default settings file to be supplemented with additional
settings. It is possible to replace all settings in this way, so a
complete configuration file can be used.

This needs to be tested.
@mcanevet
Copy link

@matthewfranglen why not using include_dir 'conf.d'?

@matthewfranglen
Copy link
Author

That would be within the $PGDATA folder which cannot have any content before initdb is run. There is a discussion of the options on the ticket that this references (#105).

The relevant error is:

postgres_1      | initdb: directory "/var/lib/postgresql/data" exists but is not empty
postgres_1      | If you want to create a new database system, either remove or empty
postgres_1      | the directory "/var/lib/postgresql/data" or run initdb
postgres_1      | with an argument other than "/var/lib/postgresql/data".

So the folder must be completely empty.

@joaocc
Copy link

joaocc commented Jul 21, 2016

Following @matthewfranglen's line of thought, why not include_dir '/etc/postgres/conf.d'?
This way we would support those who want to map the folder outside the container, and not get in the way of initdb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants