I've just spent 20min trying to allow remote connections to a PostgresSQL database running on Ubuntu.
I did it before so I thought it was a 5min thing .. well no.
I updated the pg_hba.conf as usual and added entry for the client's host.
No problem so far. Then I restarted the service and tried to connect .. but I got this message:
FATAL: no pg_hba.conf entry for host "XXX.XXX.XXX.XXX", user "username", database "dbname", SSL off
Well .. I double checked my config and found nothing wrong.
Then I restarted the server again, but this time I noticed something odd. The command yielded no output.
Not knowing where to start, I begin by doing a cat on /etc/init.d/postgresql and see this:
# versions can be specified explicitly
if [ -n "$2" ]; then
versions="$2 $3 $4 $5 $6 $7 $8 $9"
else
get_versions
fi
case "$1" in
start|stop|restart|reload|status)
for v in $versions; do
$1 $v
done
;;
force-reload)
for v in $versions; do
reload $v
done
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload|status} [version ..]"
exit 1
;;
esac
exit 0
Interestingly .. the command can take a database version number as argument. OK let's try this:
$: sudo /etc/init.d/postgresql restart 8.4
* Restarting PostgreSQL 8.4 database server
Win.
Apparently for some reason the get_versions isn't working.
Another day, another bug.
no comments :|