PGPORT=5432
PGDATA=/library/pgsql-xs/data-8.4
#PGOPTS=' -'

# Choose a config file depending on memory
MEMSIZE=$(grep '^MemTotal' /proc/meminfo | grep -oP '\d+')
CONFMEM=256m
# Note: the sizes are rounded to a lower value
#       as they are usually reported a tad lower than the
#       "proper" MB value in bytes (video cards often steal RAM!).
if [ $MEMSIZE -gt  500000 ]; then
    CONFMEM=512m
fi
if [ $MEMSIZE -gt 1000000 ]; then
    CONFMEM=1024m
fi
if [ $MEMSIZE -gt 2000000 ]; then
    CONFMEM=2048m
fi
PGCONF="/etc/pgsql-xs/postgresql-$CONFMEM.conf"
if [ -e $PGCONF ];then
    PGOPTS=" -c config_file=$PGCONF "
fi
