Adding support for PostgreSQL 14 and 15

This commit is contained in:
Larry Gadallah 2023-12-17 18:54:40 -08:00 committed by Charlie Root
parent a4ade4003c
commit a655dfea2a
1 changed files with 14 additions and 0 deletions

View File

@ -24,6 +24,14 @@ password=$(cat /dev/random | env LC_CTYPE=C tr -dc a-zA-Z0-9 | head -c 20)
echo "Install PostgreSQL and create the database and users\n"
#postgres install
if [ ."$database_version" = ."15" ]; then
pkg install --yes postgresql15-server
#cd /usr/ports/databases/postgresql15-server/ && make install clean BATCH=yes
fi
if [ ."$database_version" = ."14" ]; then
pkg install --yes postgresql14-server
#cd /usr/ports/databases/postgresql14-server/ && make install clean BATCH=yes
fi
if [ ."$database_version" = ."13" ]; then
pkg install --yes postgresql13-server
#cd /usr/ports/databases/postgresql13-server/ && make install clean BATCH=yes
@ -64,6 +72,12 @@ echo 'postgresql_enable=true' >> /etc/rc.conf
/usr/local/etc/rc.d/postgresql initdb
#start postgresql
if [ ."$database_version" = ."15" ]; then
sudo -u postgres /usr/local/bin/pg_ctl -D /var/db/postgres/data15 start
fi
if [ ."$database_version" = ."14" ]; then
sudo -u postgres /usr/local/bin/pg_ctl -D /var/db/postgres/data14 start
fi
if [ ."$database_version" = ."13" ]; then
sudo -u postgres /usr/local/bin/pg_ctl -D /var/db/postgres/data13 start
fi