diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 110061c59..ca96df524 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,10 +1,10 @@ FROM mcr.microsoft.com/mirror/docker/library/ubuntu:22.04 ARG POSTGRES_INSTALL_ARG= -ARG PG_VERSION=16 +ARG IVORY_VERSION=4 ARG CITUS_VERSION=12 # declare installed PG version and Citus version -ENV PG_VERSION=${PG_VERSION} +ENV IVORY_VERSION=${IVORY_VERSION} ENV CITUS_VERSION=${CITUS_VERSION} # Install build essentials - Compiler, debugger, make, etc. @@ -35,6 +35,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ libtool \ libicu-dev \ libssl-dev \ + libxml2-dev \ && rm -rf /var/lib/apt/lists/* # Add pgdg repo @@ -60,15 +61,15 @@ COPY scripts/utils.sh /tmp/install_setup/ # Install postgres COPY scripts/install_setup_postgres.sh /tmp/install_setup/ -RUN [ "bin/bash", "-c", "/tmp/install_setup/install_setup_postgres.sh -d \"/usr/lib/postgresql/${PG_VERSION}\" $POSTGRES_INSTALL_ARG -v ${PG_VERSION}" ] +RUN [ "bin/bash", "-c", "/tmp/install_setup/install_setup_postgres.sh -d \"/var/local/ivorysql/ivory-${IVORY_VERSION}\" $POSTGRES_INSTALL_ARG -v ${IVORY_VERSION}" ] # Install RUM from source COPY scripts/install_setup_rum_oss.sh /tmp/install_setup/ -RUN [ "bin/bash", "-c", "PGVERSION=$PG_VERSION /tmp/install_setup/install_setup_rum_oss.sh" ] +RUN [ "bin/bash", "-c", "IVORYVERSION=$IVORY_VERSION /tmp/install_setup/install_setup_rum_oss.sh" ] # Install citus COPY scripts/install_setup_citus_core_oss.sh /tmp/install_setup/ -RUN [ "bin/bash", "-c", "PGVERSION=$PG_VERSION /tmp/install_setup/install_setup_citus_core_oss.sh ${CITUS_VERSION}" ] +RUN [ "bin/bash", "-c", "IVORYVERSION=$IVORY_VERSION /tmp/install_setup/install_setup_citus_core_oss.sh ${CITUS_VERSION}" ] # Install citus-indent COPY scripts/install_citus_indent.sh /tmp/install_setup/ @@ -76,11 +77,11 @@ RUN [ "bin/bash", "-c", "/tmp/install_setup/install_citus_indent.sh" ] # Install SYSTEM_ROWS COPY scripts/install_setup_system_rows.sh /tmp/install_setup/ -RUN [ "bin/bash", "-c", "PGVERSION=$PG_VERSION /tmp/install_setup/install_setup_system_rows.sh" ] +RUN [ "bin/bash", "-c", "IVORYVERSION=$IVORY_VERSION /tmp/install_setup/install_setup_system_rows.sh" ] # Install PG_CRON COPY scripts/install_setup_pg_cron.sh /tmp/install_setup/ -RUN [ "bin/bash", "-c", "PGVERSION=$PG_VERSION /tmp/install_setup/install_setup_pg_cron.sh" ] +RUN [ "bin/bash", "-c", "IVORYVERSION=$IVORY_VERSION /tmp/install_setup/install_setup_pg_cron.sh" ] # Download Decimal128 Intel library COPY scripts/install_setup_intel_decimal_math_lib.sh /tmp/install_setup/ @@ -92,7 +93,7 @@ RUN [ "bin/bash", "-c", "/tmp/install_setup/install_setup_pcre2.sh" ] # Install PG_VECTOR COPY scripts/install_setup_pgvector.sh /tmp/install_setup/ -RUN [ "bin/bash", "-c", "PGVERSION=$PG_VERSION /tmp/install_setup/install_setup_pgvector.sh" ] +RUN [ "bin/bash", "-c", "IVORYVERSION=$IVORY_VERSION /tmp/install_setup/install_setup_pgvector.sh" ] # Install PostGIS from source RUN apt-get update && \ @@ -105,7 +106,7 @@ RUN apt-get update && \ && rm -rf /var/lib/apt/lists/* COPY scripts/install_setup_postgis.sh /tmp/install_setup/ -RUN [ "bin/bash", "-c", "PGVERSION=$PG_VERSION /tmp/install_setup/install_setup_postgis.sh" ] +RUN [ "bin/bash", "-c", "IVORYVERSION=$IVORY_VERSION /tmp/install_setup/install_setup_postgis.sh" ] # locale RUN rm -rf /var/lib/apt/lists/* \ @@ -121,10 +122,10 @@ RUN echo "%sudo ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers.d/no-pass-ask # Add postgres to path for sudo commands. # Add path for sudoers -RUN cat /etc/sudoers | grep secure_path | sed "s/\:\/bin\:/\:\/bin\:\/usr\/lib\/postgresql\/$PG_VERSION\/bin\:/" >> /etc/sudoers.d/postgres_path +RUN cat /etc/sudoers | grep secure_path | sed "s/\:\/bin\:/\:\/bin\:\/var\/local\/ivorysql\/ivory-$IVORY_VERSION\/bin\:/" >> /etc/sudoers.d/postgres_path # Add PG to the path -ENV PATH=$PATH:/usr/lib/postgresql/$PG_VERSION/bin +ENV PATH=$PATH:/var/local/ivorysql/ivory-$IVORY_VERSION/bin USER documentdb WORKDIR /home/documentdb diff --git a/scripts/build_and_start_gateway.sh b/scripts/build_and_start_gateway.sh index 9b0609e28..17b845562 100755 --- a/scripts/build_and_start_gateway.sh +++ b/scripts/build_and_start_gateway.sh @@ -84,21 +84,21 @@ while [[ -L $source ]]; do done scriptDir="$(cd -P "$(dirname "$source")" && pwd)" -# Check if PostgreSQL is running with a timeout of 10 minutes +# Check if IvorySQL is running with a timeout of 10 minutes timeout=600 interval=5 elapsed=0 -echo "Waiting for PostgreSQL to be ready on $hostname:$port..." +echo "Waiting for IvorySQL to be ready on $hostname:$port..." while ! pg_isready -h "$hostname" -p "$port" > /dev/null 2>&1; do if [ "$elapsed" -ge "$timeout" ]; then - echo "PostgreSQL did not become ready within 10 minutes. Exiting." + echo "IvorySQL did not become ready within 10 minutes. Exiting." exit 1 fi sleep "$interval" elapsed=$((elapsed + interval)) done -echo "PostgreSQL is ready." +echo "IvorySQL is ready." if [ "$clean" = "true" ]; then echo "Cleaning the build directory..." diff --git a/scripts/generate_extension_version.sh b/scripts/generate_extension_version.sh index b50b3e71d..469941629 100755 --- a/scripts/generate_extension_version.sh +++ b/scripts/generate_extension_version.sh @@ -33,7 +33,7 @@ if [ -f $gitIndexDir ]; then else # set GIT_VERSION with current branch's name and the short sha of the HEAD GIT_VERSION=$(git rev-parse --abbrev-ref HEAD) - GIT_SHA=$(git rev-parse --short HEAD) + GIT_SHA=$(git rev-parse --short=10 HEAD) fi if [[ "$GIT_VERSION" == "" ]] || [[ "$GIT_SHA" == "" ]]; then diff --git a/scripts/install_setup_citus_core_oss.sh b/scripts/install_setup_citus_core_oss.sh index 305933933..436ca5cd8 100755 --- a/scripts/install_setup_citus_core_oss.sh +++ b/scripts/install_setup_citus_core_oss.sh @@ -22,8 +22,8 @@ scriptDir="$( cd -P "$( dirname "$source" )" && pwd )" CITUS_REF=$(GetCitusVersion $citusVersion) . $scriptDir/utils.sh -if [ "${PGVERSION:-}" != "" ]; then - pgPath=$(GetPostgresPath $PGVERSION) +if [ "${IVORYVERSION:-}" != "" ]; then + pgPath=$(GetPostgresPath $IVORYVERSION) PATH=$pgPath:$PATH fi diff --git a/scripts/install_setup_pg_cron.sh b/scripts/install_setup_pg_cron.sh index 8ffb03dcb..b255f685d 100755 --- a/scripts/install_setup_pg_cron.sh +++ b/scripts/install_setup_pg_cron.sh @@ -20,7 +20,7 @@ scriptDir="$( cd -P "$( dirname "$source" )" && pwd )" CITUS_PG_CRON_REF=$(GetPgCronVersion) . $scriptDir/utils.sh -pgBinDir=$(GetPostgresPath $PGVERSION) +pgBinDir=$(GetPostgresPath $IVORYVERSION) PATH=$pgBinDir:$PATH; pushd $INSTALL_DEPENDENCIES_ROOT diff --git a/scripts/install_setup_pgvector.sh b/scripts/install_setup_pgvector.sh index 629336a43..c8a02177f 100755 --- a/scripts/install_setup_pgvector.sh +++ b/scripts/install_setup_pgvector.sh @@ -18,7 +18,7 @@ scriptDir="$( cd -P "$( dirname "$source" )" && pwd )" echo "scriptDir: $scriptDir" . $scriptDir/utils.sh -pgBinDir=$(GetPostgresPath $PGVERSION) +pgBinDir=$(GetPostgresPath $IVORYVERSION) PATH=$pgBinDir:$PATH; . $scriptDir/setup_versions.sh diff --git a/scripts/install_setup_postgis.sh b/scripts/install_setup_postgis.sh index 01af6ac5c..47b946422 100755 --- a/scripts/install_setup_postgis.sh +++ b/scripts/install_setup_postgis.sh @@ -27,7 +27,7 @@ scriptDir="$( cd -P "$( dirname "$source" )" && pwd )" POSTGIS_REF=$(GetPostgisVersion) . $scriptDir/utils.sh -pgBinDir=$(GetPostgresPath $PGVERSION) +pgBinDir=$(GetPostgresPath $IVORYVERSION) POSTGIS_REPO=postgis-repo rm -rf $POSTGIS_REPO diff --git a/scripts/install_setup_postgres.sh b/scripts/install_setup_postgres.sh index 8dba78adb..dfced4608 100755 --- a/scripts/install_setup_postgres.sh +++ b/scripts/install_setup_postgres.sh @@ -5,14 +5,14 @@ set -e # fail if trying to reference a variable that is not set. set -u -postgresqlInstallDir="" +ivorysqlInstallDir="" debug="false" cassert="false" help="false"; -pgVersion="" +ivyVersion="" while getopts "d:hxcv:" opt; do case $opt in - d) postgresqlInstallDir="$OPTARG" + d) ivorysqlInstallDir="$OPTARG" ;; x) debug="true" ;; @@ -20,7 +20,7 @@ while getopts "d:hxcv:" opt; do ;; h) help="true" ;; - v) pgVersion="$OPTARG" + v) ivyVersion="$OPTARG" ;; esac @@ -34,18 +34,18 @@ while getopts "d:hxcv:" opt; do done if [ "$help" == "true" ]; then - echo "downloads postgresql-14.2 sources, build and install it." - echo "[-d] the directory to install postgresql to. Default: /usr/lib/postgresql/14" + echo "downloads IvorySQL-14.2 sources, build and install it." + echo "[-d] the directory to install IvorySQL to. Default: /usr/lib/IvorySQL/14" echo "[-x] build with debug symbols." exit 1; fi -if [ -z $postgresqlInstallDir ]; then +if [ -z $ivorysqlInstallDir ]; then echo "Postgres Install Directory must be specified." exit 1; fi -if [ -z $pgVersion ]; then +if [ -z $ivyVersion ]; then echo "PG Version must be specified"; exit 1; fi @@ -62,29 +62,29 @@ done scriptDir="$( cd -P "$( dirname "$source" )" && pwd )" . $scriptDir/setup_versions.sh -POSTGRESQL_REF=$(GetPostgresSourceRef $pgVersion) +IvorySQL_REF=$(GetPostgresSourceRef $ivyVersion) pushd $INSTALL_DEPENDENCIES_ROOT -rm -rf postgres-repo/$pgVersion -mkdir -p postgres-repo/$pgVersion -cd postgres-repo/$pgVersion +rm -rf postgres-repo/$ivyVersion +mkdir -p postgres-repo/$ivyVersion +cd postgres-repo/$ivyVersion git init -git remote add origin https://github.com/postgres/postgres +git remote add origin https://github.com/IvorySQL/IvorySQL # checkout to the commit specified in the cgmanifest.json -git fetch --depth 1 origin "$POSTGRESQL_REF" +git fetch --depth 1 origin "$IvorySQL_REF" git checkout FETCH_HEAD -echo "building and installing postgresql ref $POSTGRESQL_REF and installing to $postgresqlInstallDir..." +echo "building and installing IvorySQL ref $IvorySQL_REF and installing to $ivorysqlInstallDir..." if [ "$debug" == "true" ]; then - ./configure --enable-debug --enable-cassert --enable-tap-tests CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer" --with-openssl --prefix="$postgresqlInstallDir" --with-icu + ./configure --enable-debug --enable-cassert --enable-tap-tests CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer" --with-openssl --prefix="$ivorysqlInstallDir" --with-icu elif [ "$cassert" == "true" ]; then - ./configure --enable-debug --enable-cassert --enable-tap-tests --with-openssl --prefix="$postgresqlInstallDir" --with-icu + ./configure --enable-debug --enable-cassert --enable-tap-tests --with-openssl --prefix="$ivorysqlInstallDir" --with-icu else - ./configure --enable-debug --enable-tap-tests --with-openssl --prefix="$postgresqlInstallDir" --with-icu + ./configure --enable-debug --enable-tap-tests --with-openssl --prefix="$ivorysqlInstallDir" --with-icu fi make clean && make -sj$(cat /proc/cpuinfo | grep -c "processor") install diff --git a/scripts/install_setup_rum_oss.sh b/scripts/install_setup_rum_oss.sh index 535d0e05c..32a0b35f7 100755 --- a/scripts/install_setup_rum_oss.sh +++ b/scripts/install_setup_rum_oss.sh @@ -21,8 +21,8 @@ echo "scriptDir: $scriptDir" RUM_REF=$(GetRumVersion) . $scriptDir/utils.sh -if [ "${PGVERSION:-}" != "" ]; then - pgPath=$(GetPostgresPath $PGVERSION) +if [ "${IVORYVERSION:-}" != "" ]; then + pgPath=$(GetPostgresPath $IVORYVERSION) PATH=$pgPath:$PATH fi diff --git a/scripts/install_setup_system_rows.sh b/scripts/install_setup_system_rows.sh index 3282401c5..f67e63bf1 100755 --- a/scripts/install_setup_system_rows.sh +++ b/scripts/install_setup_system_rows.sh @@ -17,7 +17,7 @@ done scriptDir="$( cd -P "$( dirname "$source" )" && pwd )" . $scriptDir/utils.sh . $scriptDir/setup_versions.sh -POSTGRESQL_REF=$(GetPostgresSourceRef $PGVERSION) +POSTGRESQL_REF=$(GetPostgresSourceRef $IVORYVERSION) pushd $INSTALL_DEPENDENCIES_ROOT @@ -26,13 +26,13 @@ mkdir postgres-repo-for-system-rows cd postgres-repo-for-system-rows git init -git remote add origin https://github.com/postgres/postgres +git remote add origin https://github.com/IvorySQL/IvorySQL # checkout to the commit specified in the cgmanifest.json git fetch --depth 1 origin "$POSTGRESQL_REF" git checkout FETCH_HEAD -pgBinDir=$(GetPostgresPath $PGVERSION) +pgBinDir=$(GetPostgresPath $IVORYVERSION) PATH=$pgBinDir:$PATH; echo "building and installing tsm_system_rows extension with pg path $pgBinDir ..." diff --git a/scripts/setup_versions.sh b/scripts/setup_versions.sh index feb0d5939..477cce5d3 100755 --- a/scripts/setup_versions.sh +++ b/scripts/setup_versions.sh @@ -8,11 +8,11 @@ set -e # declare all the versions of dependencies LIBBSON_VERSION=1.28.0 # This maps to REL_17_4:f8554dee417ffc4540c94cf357f7bf7d4b6e5d80 -POSTGRES_17_REF="REL_17_4" +IvorySQL_4_REF="IvorySQL_4.5" # This maps to REL_16_8:71eb35c0b18de96537bd3876ec9bf8075bfd484f -POSTGRES_16_REF="REL_16_8" +IvorySQL_3_REF="IvorySQL_3.4" # This maps to REL15_12:50d3d22baba63613d1f1406b2ed460dc9b03c3fc -POSTGRES_15_REF="REL_15_12" +IvorySQL_2_REF="Ivory_REL_2_3" # This is commit f3cb3d99eed7dd3db82104ab2a4a13b1233d0023 CITUS_VERSION=v12.1.7 # This is commit d28a5eae6c78935313824d319480632783d48d10 @@ -31,15 +31,15 @@ UNCRUSTIFY_VERSION=uncrustify-0.68.1 function GetPostgresSourceRef() { - local pgVersion=$1 - if [ "$pgVersion" == "17" ]; then - echo $POSTGRES_17_REF - elif [ "$pgVersion" == "16" ]; then - echo $POSTGRES_16_REF - elif [ "$pgVersion" == "15" ]; then - echo $POSTGRES_15_REF + local ivyVersion=$1 + if [ "$ivyVersion" == "4" ]; then + echo $IvorySQL_4_REF + elif [ "$ivyVersion" == "3" ]; then + echo $IvorySQL_3_REF + elif [ "$ivyVersion" == "2" ]; then + echo $IvorySQL_2_REF else - echo "Invalid PG Version specified $pgVersion"; + echo "Invalid PG Version specified $ivyVersion"; exit 1; fi } @@ -47,7 +47,7 @@ function GetPostgresSourceRef() function GetCitusVersion() { local citusVersion=$1 - if [ "$PGVERSION" == "17" ]; then + if [ "$IVORYVERSION" == "4" ]; then echo $CITUS_13_VERSION elif [ "$citusVersion" == "13" ] || [ "$citusVersion" == "v13.0" ] || [ "$citusVersion" == "$CITUS_13_VERSION" ]; then echo $CITUS_13_VERSION diff --git a/scripts/start_oss_server.sh b/scripts/start_oss_server.sh index c56d5f40e..fd6d0a44f 100755 --- a/scripts/start_oss_server.sh +++ b/scripts/start_oss_server.sh @@ -5,9 +5,9 @@ set -e # fail if trying to reference a variable that is not set. set -u -PG_VERSION=${PG_VERSION_USED:-16} +IVY_VERSION=${IVY_VERSION_USED:-4} coordinatorPort="9712" -postgresDirectory="" +ivoryDirectory="" initSetup="false" forceCleanup="false" help="false" @@ -16,7 +16,7 @@ distributed="false" allowExternalAccess="false" while getopts "d:p:hcsxe" opt; do case $opt in - d) postgresDirectory="$OPTARG" + d) ivoryDirectory="$OPTARG" ;; c) initSetup="true" forceCleanup="true" @@ -53,7 +53,7 @@ if [ "$help" == "true" ]; then echo "${green}[-c] - optional argument. FORCE cleanup - removes all existing data and reinitializes" echo "${green}[-s] - optional argument. Stops all servers and exits" echo "${green}[-x] - start oss server with documentdb_distributed extension" - echo "${green}[-e] - optional argument. Allows PostgreSQL access from any IP address" + echo "${green}[-e] - optional argument. Allows IvorySQL access from any IP address" echo "${green}[-p ] - optional argument. specifies the port for the coordinator" echo "${green}if postgresDir not specified assumed to be /data" exit 1; @@ -96,56 +96,56 @@ scriptDir="$( cd -P "$( dirname "$source" )" && pwd )" . $scriptDir/utils.sh -if [ -z $postgresDirectory ]; then - postgresDirectory="/data" +if [ -z $ivoryDirectory ]; then + ivoryDirectory="/data" fi -# Only initialize if directory doesn't exist, is empty, or doesn't contain a valid PostgreSQL data directory -# Check for PG_VERSION file which indicates a valid PostgreSQL data directory -if [ ! -d "$postgresDirectory" ]; then +# Only initialize if directory doesn't exist, is empty, or doesn't contain a valid IvorySQL data directory +# Check for IVY_VERSION file which indicates a valid IvorySQL data directory +if [ ! -d "$ivoryDirectory" ]; then # Directory doesn't exist, we need to initialize - echo "${green}Directory $postgresDirectory doesn't exist, will initialize PostgreSQL data directory${reset}" + echo "${green}Directory $ivoryDirectory doesn't exist, will initialize IvorySQL data directory${reset}" initSetup="true" -elif [ ! -f "$postgresDirectory/PG_VERSION" ]; then - # Directory exists but no PG_VERSION file - if [ "$(ls -A "$postgresDirectory" 2>/dev/null)" ]; then - # Directory exists and is not empty but doesn't have PG_VERSION +elif [ ! -f "$ivoryDirectory/IVY_VERSION" ]; then + # Directory exists but no IVY_VERSION file + if [ "$(ls -A "$ivoryDirectory" 2>/dev/null)" ]; then + # Directory exists and is not empty but doesn't have IVY_VERSION # This might be a corrupted or incompatible data directory - echo "${red}Warning: Directory $postgresDirectory exists but doesn't appear to contain a valid PostgreSQL data directory.${reset}" + echo "${red}Warning: Directory $ivoryDirectory exists but doesn't appear to contain a valid IvorySQL data directory.${reset}" echo "${red}Use -c flag to force cleanup and re-initialization, or specify a different directory with -d.${reset}" exit 1 else # Directory exists but is empty, we can initialize - echo "${green}Directory $postgresDirectory is empty, will initialize PostgreSQL data directory${reset}" + echo "${green}Directory $ivoryDirectory is empty, will initialize IvorySQL data directory${reset}" initSetup="true" fi else - # Directory exists and has PG_VERSION, check if it's compatible - echo "${green}Found existing PostgreSQL data directory at $postgresDirectory${reset}" + # Directory exists and has IVY_VERSION, check if it's compatible + echo "${green}Found existing IvorySQL data directory at $ivoryDirectory${reset}" fi # We stop the coordinator first and the worker node servers # afterwards. However this order is not required and it doesn't # really matter which order we choose to stop the active servers. echo "${green}Stopping any existing postgres servers${reset}" -StopServer $postgresDirectory +StopServer $ivoryDirectory if [ "$stop" == "true" ]; then exit 0; fi -echo "InitDatabaseExtended $initSetup $postgresDirectory" +echo "InitDatabaseExtended $initSetup $ivoryDirectory" if [ "$initSetup" == "true" ]; then - InitDatabaseExtended $postgresDirectory "$preloadLibraries" + InitDatabaseExtended $ivoryDirectory "$preloadLibraries" fi -# Update PostgreSQL configuration to allow access from any IP +# Update IvorySQL configuration to allow access from any IP if [ "$allowExternalAccess" == "true" ]; then - postgresConfigFile="$postgresDirectory/postgresql.conf" - hbaConfigFile="$postgresDirectory/pg_hba.conf" + postgresConfigFile="$ivoryDirectory/postgresql.conf" + hbaConfigFile="$ivoryDirectory/pg_hba.conf" - echo "${green}Configuring PostgreSQL to allow access from any IP address${reset}" + echo "${green}Configuring IvorySQL to allow access from any IP address${reset}" echo "listen_addresses = '*'" >> $postgresConfigFile echo "host all all 0.0.0.0/0 scram-sha-256" >> $hbaConfigFile echo "host all all ::0/0 scram-sha-256" >> $hbaConfigFile @@ -155,7 +155,7 @@ userName=$(whoami) sudo mkdir -p /var/run/postgresql sudo chown -R $userName:$userName /var/run/postgresql -StartServer $postgresDirectory $coordinatorPort +StartServer $ivoryDirectory $coordinatorPort if [ "$initSetup" == "true" ]; then SetupPostgresServerExtensions "$userName" $coordinatorPort $extensionName diff --git a/scripts/utils.sh b/scripts/utils.sh index 6ff203349..70d46506f 100755 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -21,43 +21,37 @@ trap 'error ${LINENO}' ERR function GetPostgresPath() { - local pgVersion=$1 - local osVersion=$(cat /etc/os-release | grep "^ID="); - - if [[ "$osVersion" == "ID=ubuntu" || "$osVersion" == "ID=debian"|| "$osVersion" == "ID=mariner" || "$osVersion" == "ID=azurelinux" ]]; then - echo "/usr/lib/postgresql/$pgVersion/bin" - else - echo "/usr/pgsql-$pgVersion/bin" - fi + local ivyVersion=$1 + echo "/var/local/ivorysql/ivory-$ivyVersion/bin" } function GetPostgresSourceRef() { - local pgVersion=$1 - if [ "$pgVersion" == "16" ]; then + local ivyVersion=$1 + if [ "$ivyVersion" == "3" ]; then # This maps to REL_16_2:b78fa8547d02fc72ace679fb4d5289dccdbfc781 - POSTGRESQL_REF="REL_16_2" - elif [ "$pgVersion" == "15" ]; then + IvorySQL_REF="IvorySQL_3.4" + elif [ "$ivyVersion" == "2" ]; then # This maps to REL15_3:8382864eb5c9f9ebe962ac20b3392be5ae304d23 - POSTGRESQL_REF="REL_15_3" + IvorySQL_REF="Ivory_REL_2_3" else - echo "Invalid PG Version specified $pgVersion"; + echo "Invalid PG Version specified $ivyVersion"; exit 1; fi - echo $POSTGRESQL_REF + echo $IvorySQL_REF } function GetPGCTL() { - local pgVersion=${PG_VERSION:-16} - echo ${pgctlPath:-$(GetPostgresPath $pgVersion)/pg_ctl} + local ivyVersion=${IVY_VERSION:-4} + echo ${pgctlPath:-$(GetPostgresPath $ivyVersion)/pg_ctl} } function GetInitDB() { - local pgVersion=${PG_VERSION:-16} - echo $(GetPostgresPath $pgVersion)/initdb + local ivyVersion=${IVY_VERSION:-4} + echo $(GetPostgresPath $ivyVersion)/initdb } function StopServer() @@ -106,7 +100,7 @@ function InitDatabaseExtended() local _directory=$1 local _preloadLibraries=$2 - echo "Initializing PostgreSQL database in $_directory with preload libraries: $_preloadLibraries" + echo "Initializing IvorySQL database in $_directory with preload libraries: $_preloadLibraries" if [ -d "$_directory" ]; then echo "Removing contents of $_directory"