FAQs 1: How to solve PostgreSQL’s replication error "FATAL: using recovery command file "recovery.conf" is not supported"?

Here is the issue, I was setting up PostgreSQL replication for PostgreSQL 14, following the steps from different online tutorials and faced the following error:
FATAL: XX000: using recovery command file "recovery.conf" is not supported
What's the wrong in my setup, I do exactly the same steps, and suddenly the tutorials were old. Actually they were for PostgreSQL Versions 11 and earlier. And since PostgreSQL version 12 and higher this file not supported anymore and replaced by "standby.signal" file.

For PostgreSQL V12 and higher to setup the replica/standby server in standby mode, the "standby.signal" file must exists.

Either I use -R option with pg_basebackup to create it:
$ pg_basebackup -h ${PG_PRIMARY} -U ${PG_REP_USER} -w --checkpoint=fast -D ${PGDATA} -R --slot=some_name -C --port=5432 -vP
OR if -R not used with pg_basebackup command, I can create it manually:
$ touch $PGDATA/standby.signal

FAQs 2: How to change Time/Timezone in Docker container?

We'll show you how to change time in Docker container to desire time zones. Changing time in Docker container environment can be done in several ways.

Way 1: Running Docker Container

In this case we've a running docker container and we need to set time/timezone without restart/rebuild it.

The easiest way to change date time in a Docker container is to change the time using date command after connecting to the container.
# docker exec -it  /bin/bash
# date +%T -s "16:16:00"
16:16:00
Though the time zone change usually reflects immediately, in some cases, the container needs to be restarted to have effect.

Way 2: Using Environment Variables

The timezone of a container can be set using an environment variable in the docker container when it is created.
docker run -e TZ=Africa/Cairo ubuntu date
The time zone data package tzdata needs to be installed in the container for setting this timezone variable. Usually, it is already installed inside the container. If not, you can install it yourself inside the container.

Way 3: Using Dockerfile

In some cases which need too many identical containers to be spun up, the easiest way to manage is using Dockerfile.

The Dockerfile contains the basic configuration settings for each container. To change time in Docker container, the changes can be done in the corresponding Dockerfile.

The settings in the Dockerfile would reflect while recreating or adding a new container. And, all commands from the Docker file will be run as the root user. The entry in Dockerfile would look like:
RUN echo "Africa/Johannesburg" > /etc/timezone
RUN dpkg-reconfigure -f noninteractive tzdata
The installation command for tzdata package would vary based on the OS image that the container is using.