This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/arrow-flight-sql-postgresql.git


The following commit(s) were added to refs/heads/main by this push:
     new 3fd6404  Don't use initdb --set in dev/run-postgresql.sh (#148)
3fd6404 is described below

commit 3fd64046964fcce6ab43c3ff8048614e1699c04d
Author: Sutou Kouhei <[email protected]>
AuthorDate: Tue Oct 17 17:23:47 2023 +0900

    Don't use initdb --set in dev/run-postgresql.sh (#148)
    
    Closes GH-113
    
    Because it's available since PostgreSQL 16.
---
 dev/run-postgresql.sh | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/dev/run-postgresql.sh b/dev/run-postgresql.sh
index 834b618..2f255c3 100755
--- a/dev/run-postgresql.sh
+++ b/dev/run-postgresql.sh
@@ -47,13 +47,24 @@ base_directory="$(cd "$(dirname "$0")" && pwd)"
 
 rm -rf "${data_directory}"
 
-initdb \
-  --locale=C \
-  --set=arrow_flight_sql.uri=${scheme}://${server_name}:15432 \
-  --set=shared_preload_libraries=arrow_flight_sql \
-  --set=ssl=${ssl} \
-  --set=ssl_ca_file=${ssl_ca_file} \
-  "${data_directory}"
+if LANG=C initdb --help | grep -q -- --set; then
+  initdb \
+    --locale=C \
+    --set=arrow_flight_sql.uri=${scheme}://${server_name}:15432 \
+    --set=shared_preload_libraries=arrow_flight_sql \
+    --set=ssl=${ssl} \
+    --set=ssl_ca_file=${ssl_ca_file} \
+    "${data_directory}"
+else
+  initdb \
+    --locale=C \
+    "${data_directory}"
+  (echo "arrow_flight_sql.uri = '${scheme}://${server_name}:15432'"; \
+   echo "shared_preload_libraries = 'arrow_flight_sql'"; \
+   echo "ssl = ${ssl}"; \
+   echo "ssl_ca_file = '${ssl_ca_file}'") | \
+    tee -a "${data_directory}/postgresql.conf"
+fi
 if [ "${ssl}" = "on" ]; then
   pushd "${data_directory}"
   "${base_directory}/prepare-tls.sh" \

Reply via email to