Skip to content

Commit caea64d

Browse files
authored
Merge pull request #489 from hhorak/add-15
Add PostgreSQL 15
2 parents d6cfde1 + 09b84c7 commit caea64d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1707
-281
lines changed

10/Dockerfile.rhel8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ RUN yum -y module enable postgresql:10 && \
4747
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
4848
rpm -V $INSTALL_PKGS && \
4949
postgres -V | grep -qe "$POSTGRESQL_VERSION\." && echo "Found VERSION $POSTGRESQL_VERSION" && \
50-
yum -y reinstall tzdata && \
50+
(yum -y reinstall tzdata || yum -y update tzdata ) && \
5151
yum -y clean all --enablerepo='*' && \
5252
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
5353
test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)" && \

10/content_sets.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

10/root/usr/share/container-scripts/postgresql/README.md

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ $ podman run -d --name postgresql_database \
133133
-e POSTGRESQL_MIGRATION_REMOTE_HOST=172.17.0.2 \
134134
-e POSTGRESQL_MIGRATION_ADMIN_PASSWORD=remoteAdminP@ssword \
135135
[ OPTIONAL_CONFIGURATION_VARIABLES ]
136-
openshift/postgresql-92-centos7
136+
rhel8/postgresql-13
137137
```
138138

139139
The migration is done the **dump and restore** way (running `pg_dumpall` against
@@ -147,7 +147,7 @@ result of scripted, unattended migration. In most common cases, successful
147147
migration is expected (but not guaranteed!), given you migrate from
148148
a previous version of PostgreSQL server container, that is created using
149149
the same principles as this one (e.g. migration from
150-
`openshift/postgresql-92-centos7` to `centos/postgresql-95-centos7`).
150+
`rhel8/postgresql-12` to `rhel8/postgresql-13`).
151151
Migration from a different kind of PostgreSQL container can likely fail.
152152

153153
If this **all** or **nothing** principle is inadequate for you, and you know
@@ -208,42 +208,6 @@ container starts it will reset the passwords to the values stored in the
208208
environment variables.
209209

210210

211-
Upgrading database (by switching to newer PostgreSQL image version)
212-
-------------------------------------------------------------------
213-
214-
** Warning! Please, before you decide to do the data directory upgrade, always
215-
ensure that you've carefully backed up all your data and that you are OK with
216-
potential manual rollback! **
217-
218-
This image supports automatic upgrade of data directory created by
219-
the PostgreSQL server version 9.6 (and _only_ this version) - provided by sclorg
220-
image. The upgrade process is designed so that you should be able to just
221-
switch from *image A* to *image B*, and set the `$POSTGRESQL_UPGRADE` variable
222-
appropriately to explicitly request the database data transformation.
223-
224-
The upgrade process is internally implemented via `pg_upgrade` binary, and for
225-
that purpose the container needs to contain two versions of PostgreSQL server
226-
(have a look at `man pg_upgrade` for more info).
227-
228-
For the `pg_upgrade` process - and the new server version, we need to initialize
229-
a brand new data directory. That's data directory is created automatically by
230-
container tooling under /var/lib/pgsql/data, which is usually external
231-
bind-mountpoint. The `pg_upgrade` execution is then similar to dump&restore
232-
approach -- it starts both old and new PostgreSQL servers (within container) and
233-
"dumps" the old datadir while and at the same time it "restores" it into new
234-
datadir. This operation requires a lot of data files copying, so you can decide
235-
what type of upgrade you'll do by setting `$POSTGRESQL_UPGRADE` appropriately:
236-
237-
**`copy`**
238-
The data files are copied from old datadir to new datadir. This option has low risk of data loss in case of some upgrade failure.
239-
240-
**`hardlink`**
241-
Data files are hard-linked from old to the new data directory, which brings performance optimization - but the old directory becomes unusable, even in case of failure.
242-
243-
244-
Note that because we copy data directory, you need to make sure that you have
245-
enough space for the copy; upgrade failure because of not enough space might
246-
lead to data loss.
247211

248212

249213
Extending image

10/root/usr/share/container-scripts/postgresql/common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ function create_users() {
227227

228228
if [ -v POSTGRESQL_MASTER_USER ]; then
229229
createuser "$POSTGRESQL_MASTER_USER"
230+
echo "ALTER DATABASE postgres OWNER TO $POSTGRESQL_MASTER_USER;" | psql
231+
echo "GRANT ALL PRIVILEGES on DATABASE postgres TO $POSTGRESQL_MASTER_USER;" | psql
230232
fi
231233
}
232234

12/Dockerfile.rhel8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ RUN yum -y module enable postgresql:12 && \
4848
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
4949
rpm -V $INSTALL_PKGS && \
5050
postgres -V | grep -qe "$POSTGRESQL_VERSION\." && echo "Found VERSION $POSTGRESQL_VERSION" && \
51-
yum -y reinstall tzdata && \
51+
(yum -y reinstall tzdata || yum -y update tzdata ) && \
5252
yum -y clean all --enablerepo='*' && \
5353
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
5454
test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)" && \

12/content_sets.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

12/root/usr/share/container-scripts/postgresql/README.md

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ $ podman run -d --name postgresql_database \
133133
-e POSTGRESQL_MIGRATION_REMOTE_HOST=172.17.0.2 \
134134
-e POSTGRESQL_MIGRATION_ADMIN_PASSWORD=remoteAdminP@ssword \
135135
[ OPTIONAL_CONFIGURATION_VARIABLES ]
136-
openshift/postgresql-92-centos7
136+
rhel8/postgresql-13
137137
```
138138

139139
The migration is done the **dump and restore** way (running `pg_dumpall` against
@@ -147,7 +147,7 @@ result of scripted, unattended migration. In most common cases, successful
147147
migration is expected (but not guaranteed!), given you migrate from
148148
a previous version of PostgreSQL server container, that is created using
149149
the same principles as this one (e.g. migration from
150-
`openshift/postgresql-92-centos7` to `centos/postgresql-95-centos7`).
150+
`rhel8/postgresql-12` to `rhel8/postgresql-13`).
151151
Migration from a different kind of PostgreSQL container can likely fail.
152152

153153
If this **all** or **nothing** principle is inadequate for you, and you know
@@ -208,42 +208,6 @@ container starts it will reset the passwords to the values stored in the
208208
environment variables.
209209

210210

211-
Upgrading database (by switching to newer PostgreSQL image version)
212-
-------------------------------------------------------------------
213-
214-
** Warning! Please, before you decide to do the data directory upgrade, always
215-
ensure that you've carefully backed up all your data and that you are OK with
216-
potential manual rollback! **
217-
218-
This image supports automatic upgrade of data directory created by
219-
the PostgreSQL server version 10 (and _only_ this version) - provided by sclorg
220-
image. The upgrade process is designed so that you should be able to just
221-
switch from *image A* to *image B*, and set the `$POSTGRESQL_UPGRADE` variable
222-
appropriately to explicitly request the database data transformation.
223-
224-
The upgrade process is internally implemented via `pg_upgrade` binary, and for
225-
that purpose the container needs to contain two versions of PostgreSQL server
226-
(have a look at `man pg_upgrade` for more info).
227-
228-
For the `pg_upgrade` process - and the new server version, we need to initialize
229-
a brand new data directory. That's data directory is created automatically by
230-
container tooling under /var/lib/pgsql/data, which is usually external
231-
bind-mountpoint. The `pg_upgrade` execution is then similar to dump&restore
232-
approach -- it starts both old and new PostgreSQL servers (within container) and
233-
"dumps" the old datadir while and at the same time it "restores" it into new
234-
datadir. This operation requires a lot of data files copying, so you can decide
235-
what type of upgrade you'll do by setting `$POSTGRESQL_UPGRADE` appropriately:
236-
237-
**`copy`**
238-
The data files are copied from old datadir to new datadir. This option has low risk of data loss in case of some upgrade failure.
239-
240-
**`hardlink`**
241-
Data files are hard-linked from old to the new data directory, which brings performance optimization - but the old directory becomes unusable, even in case of failure.
242-
243-
244-
Note that because we copy data directory, you need to make sure that you have
245-
enough space for the copy; upgrade failure because of not enough space might
246-
lead to data loss.
247211

248212

249213
Extending image

12/root/usr/share/container-scripts/postgresql/common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ function create_users() {
227227

228228
if [ -v POSTGRESQL_MASTER_USER ]; then
229229
createuser "$POSTGRESQL_MASTER_USER"
230+
echo "ALTER DATABASE postgres OWNER TO $POSTGRESQL_MASTER_USER;" | psql
231+
echo "GRANT ALL PRIVILEGES on DATABASE postgres TO $POSTGRESQL_MASTER_USER;" | psql
230232
fi
231233
}
232234

13/Dockerfile.rhel8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ RUN yum -y module enable postgresql:13 && \
4848
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
4949
rpm -V $INSTALL_PKGS && \
5050
postgres -V | grep -qe "$POSTGRESQL_VERSION\." && echo "Found VERSION $POSTGRESQL_VERSION" && \
51-
yum -y reinstall tzdata && \
51+
(yum -y reinstall tzdata || yum -y update tzdata ) && \
5252
yum -y clean all --enablerepo='*' && \
5353
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
5454
test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)" && \

13/Dockerfile.rhel9

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ RUN { yum -y module enable postgresql:13 || :; } && \
4848
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
4949
rpm -V $INSTALL_PKGS && \
5050
postgres -V | grep -qe "$POSTGRESQL_VERSION\." && echo "Found VERSION $POSTGRESQL_VERSION" && \
51-
yum -y reinstall tzdata && \
51+
(yum -y reinstall tzdata || yum -y update tzdata ) && \
5252
yum -y clean all --enablerepo='*' && \
5353
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
5454
test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)" && \

0 commit comments

Comments
 (0)