Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: snippet finetuning

...

To try to fix your PostgreSQL installation in a debian or similar environment:

Overall (several variants, read before execution)

No Format
# download
#sudo apt-get install ca-certificates
wget https://download.clazzes.org/pg_fix_usermappings/pg_fix_usermappings.sh \
  -O /tmp/pg_fix_usermappings.sh


# make it executable, for user postgres
chmod ugo+rx /tmp/pg_fix_usermappings.sh


# it's safe to call the script without any parameters ...
/tmp/pg_fix_usermappings.sh

# #think executeabout forversion
9.6 as root
sudo -u postgres pg_fix_usermappings.sh 9.6
ls -ld /etc/postgresql/*
dpkg -l |egrep " postgresql-9.[0-9] "

# or execute for 9.6 as non- root sudologging sudothe -uoutput
postgres pg_fix_usermappings.sh export MYPGVER=9.6


# execute for 9.6 for the bold skipping do-you-really-want-it backcheck
( sudo sudo -u postgres /tmp/pg_fix_usermappings.sh --yes 9.6


# recommendation: log the output
( sudo sudo -u postgres pg_fix_usermappings.sh 9.6 ) ${MYPGVER} ) \
  2>&1 |tee /var/tmp/pg_fix_usermappings_${MYPGVER}.log

# after success maybe document
sudo mv -v /tmp/pg_fix_usermappings.sh /var/tmp/pg_fix_usermappings*.log /var/log/postgresql/

...