revert: "chore: Update postgres version references"

Reverts #33987
This commit is contained in:
Abhijeet 2024-06-10 15:32:18 +05:30 committed by GitHub
commit f5832a8e2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 7 deletions

View File

@ -423,18 +423,17 @@ init_postgres() {
# Postgres does not allow it's server to be run with super user access, we use user postgres and the file system owner also needs to be the same user postgres
chown postgres:postgres "$POSTGRES_DB_PATH"
# Please refer to base.dockerfile for the installation of Postgres
# Initialize the postgres db file system
su postgres -c "/usr/lib/postgresql/current/bin/initdb -D $POSTGRES_DB_PATH"
su postgres -c "/usr/lib/postgresql/13/bin/initdb -D $POSTGRES_DB_PATH"
sed -Ei "s,^#(unix_socket_directories =).*,\\1 '$TMP/pg-runtime'," "$POSTGRES_DB_PATH/postgresql.conf"
# Start the postgres server in daemon mode
su postgres -c "/usr/lib/postgresql/current/bin/pg_ctl -D $POSTGRES_DB_PATH start"
su postgres -c "/usr/lib/postgresql/13/bin/pg_ctl -D $POSTGRES_DB_PATH start"
# Create mockdb db and user and populate it with the data
seed_embedded_postgres
# Stop the postgres daemon
su postgres -c "/usr/lib/postgresql/current/bin/pg_ctl stop -D $POSTGRES_DB_PATH"
su postgres -c "/usr/lib/postgresql/13/bin/pg_ctl stop -D $POSTGRES_DB_PATH"
fi
else
runEmbeddedPostgres=0
@ -446,14 +445,14 @@ seed_embedded_postgres(){
# Create mockdb database
psql -U postgres -c "CREATE DATABASE mockdb;"
# Create mockdb superuser
su postgres -c "/usr/lib/postgresql/current/bin/createuser mockdb -s"
su postgres -c "/usr/lib/postgresql/13/bin/createuser mockdb -s"
# Dump the sql file containing mockdb data
psql -U postgres -d mockdb --file='/opt/appsmith/templates/mockdb_postgres.sql'
# Create users database
psql -U postgres -c "CREATE DATABASE users;"
# Create users superuser
su postgres -c "/usr/lib/postgresql/current/bin/createuser users -s"
su postgres -c "/usr/lib/postgresql/13/bin/createuser users -s"
# Dump the sql file containing mockdb data
psql -U postgres -d users --file='/opt/appsmith/templates/users_postgres.sql'
}

View File

@ -1,4 +1,4 @@
#!/bin/bash
rm -f /appsmith-stacks/data/postgres/main/core.*
exec /usr/lib/postgresql/current/bin/postgres -D "/appsmith-stacks/data/postgres/main" -c listen_addresses=127.0.0.1
exec /usr/lib/postgresql/13/bin/postgres -D "/appsmith-stacks/data/postgres/main" -c listen_addresses=127.0.0.1