<commit_before>#!/bin/bash -e

VPC_CIDR=$1
DATABASE=$2

. ./postgresenv.sh

"${POSTGRESBINDIR}"/initdb -D "${POSTGRESDBDIR}"

cat ./conf/hba.conf >> "${POSTGRESDBDIR}"/pg_hba.conf

sed "s/<VPC_CIDR>/${VPC_CIDR}/g" "${POSTGRESDBDIR}"/pg_hba.conf
sed "s/<DATABASE>/${DATABASE}/g" "${POSTGRESDBDIR}"/pg_hba.conf

cat ./conf/pg.conf >> "${POSTGRESDBDIR}"/postgresql.conf
mkdir -p /var/run/postgresql/postgres-main.pg_stat_tmp

# stats configuration
cp "${POSTGRESDBDIR}"/postgresql.conf "$POSTGRES_PERF_CONF"
cat ./conf/stats.conf >> "$POSTGRES_PERF_CONF"

# wal-e configuration
cp "${POSTGRESDBDIR}"/postgresql.conf "$POSTGRES_WALE_CONF"
cat ./conf/wale.conf >> "$POSTGRES_WALE_CONF"

# HSTORE
./hstore.sh
<commit_msg>sed fix<commit_after>#!/bin/bash -ex

VPC_CIDR=$1
DATABASE=$2

. ./postgresenv.sh

"${POSTGRESBINDIR}"/initdb -D "${POSTGRESDBDIR}"

cat ./conf/hba.conf >> "${POSTGRESDBDIR}"/pg_hba.conf

sed -i "s/<VPC_CIDR>/${VPC_CIDR}/g" "${POSTGRESDBDIR}"/pg_hba.conf
sed -i "s/<DATABASE>/${DATABASE}/g" "${POSTGRESDBDIR}"/pg_hba.conf

cat ./conf/pg.conf >> "${POSTGRESDBDIR}"/postgresql.conf
mkdir -p /var/run/postgresql/postgres-main.pg_stat_tmp

# stats configuration
cp "${POSTGRESDBDIR}"/postgresql.conf "$POSTGRES_PERF_CONF"
cat ./conf/stats.conf >> "$POSTGRES_PERF_CONF"

# wal-e configuration
cp "${POSTGRESDBDIR}"/postgresql.conf "$POSTGRES_WALE_CONF"
cat ./conf/wale.conf >> "$POSTGRES_WALE_CONF"

# HSTORE
./hstore.sh

{'fraction_non_alphanumeric': 0.1970649895178197, 'fraction_numerical': 0.002795248078266946, 'mean_word_length': 5.226086956521739, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2842642', 'n_tokens_mistral': 636, 'n_tokens_neox': 653, 'n_words': 85}