This is the regular behavior as every configuration has already a default. To override some specific behavior, you’ll need to mount your config file.
If you’re just testing a configuration, you can join the container via bash:
docker exec -it your-timescale-container bash
Then, you can restart the service:
service postgresql restart
If you want to sync a configuration from your machine, use the following:
To set the PostgreSQL configuration when using the TimescaleDB-HA Docker image, you can follow these steps:
Create a new directory on your host machine to store the PostgreSQL configuration file. For example, you can create a directory named pg_conf in your home directory:
mkdir ~/pg_conf
Copy your postgresql.conf file to the pg_conf directory.
Start the timescaledb-ha container and mount the pg_conf directory to the container. You can use the -v option to mount the directory as a volume. For example:
This command will start a new TimescaleDB-HA container named my-timescaledb-ha and mount the pg_conf directory on the host machine to the /etc/postgresql/postgresql.conf.d directory inside the container.
Your PostgreSQL configuration should now be applied inside the container. You can confirm this by checking the postgresql.conf file inside the container:
The PostgreSQL configuration file postgresql.conf contains default settings and user-defined settings for the PostgreSQL server. If a setting is commented out, it means that the default value for that particular setting is being used.
Still, the fact that is commented is strange, check it thoroughly.
In your case, all the lines in the postgresql.conf file are commented, which means PostgreSQL is using the default settings for all configurations. The default value for autovacuum is true, so even if it’s commented out in the postgresql.conf file, the server will still have autovacuum enabled by default.
2
Answers
This is the regular behavior as every configuration has already a default. To override some specific behavior, you’ll need to mount your config file.
If you’re just testing a configuration, you can join the container via bash:
Then, you can restart the service:
If you want to sync a configuration from your machine, use the following:
To set the PostgreSQL configuration when using the TimescaleDB-HA Docker image, you can follow these steps:
Create a new directory on your host machine to store the PostgreSQL configuration file. For example, you can create a directory named pg_conf in your home directory:
Copy your postgresql.conf file to the pg_conf directory.
Start the timescaledb-ha container and mount the pg_conf directory to the container. You can use the
-v
option to mount the directory as a volume. For example:This command will start a new TimescaleDB-HA container named my-timescaledb-ha and mount the pg_conf directory on the host machine to the /etc/postgresql/postgresql.conf.d directory inside the container.
Your PostgreSQL configuration should now be applied inside the container. You can confirm this by checking the postgresql.conf file inside the container:
This command will display the contents of the postgresql.conf file inside the container.
That’s it! You can now start and stop the container as needed, and your PostgreSQL configuration will persist across container restarts.
The PostgreSQL configuration file
postgresql.conf
contains default settings and user-defined settings for the PostgreSQL server. If a setting is commented out, it means that the default value for that particular setting is being used.Still, the fact that is commented is strange, check it thoroughly.
In your case, all the lines in the
postgresql.conf
file are commented, which means PostgreSQL is using the default settings for all configurations. The default value forautovacuum
istrue
, so even if it’s commented out in thepostgresql.conf
file, the server will still have autovacuum enabled by default.