pg_hba.conf editor is buggy

From: damien clochard <damien(at)dalibo(dot)info>
To: pgadmin-support(at)postgresql(dot)org
Subject: pg_hba.conf editor is buggy
Date: 2011-01-06 21:33:24
Message-ID: 4D263524.9040805@dalibo.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

hi guys,

Last month during a PG training, i found a very bad behaviour from
pgadmin. Here's the step to follow :

0- backup your pg_hba.conf
1- launch pgadmin
2- edit the pg_hba.conf
3- Add a new line with an error inside the CIDR address.
For example : host all all 10.224.24.26 trust
4- save
5- close pgadmin
6- now if you edit pg_hba.conf with a generic text editor
the line you've added will appear.
7- launch pgadmin again
8- edit pg_hba.conf
9- your line doesn't appear
10- you need to modify pg_ba.conf with a text editor or restore your backup

As you may have noticed, between step 4 and step 10 you'll be unable to
start PostgreSQL because the pg_hba.conf has a syntax error.

I can't describe how much this is confusing for newbies : they write a
pg_hba rule that seems correct (they just wrote an IP Address instead of
a CIDR ) and then they restart PG to test it... Now the server won't
start and if they restart pgAdmin, then the faulty line is hidden !

What's even more confusing is the dialog window that adds a new line....
There's a field for each part of the pg_hba line. But when it comes to
the CIDR Address the field label is "IP Address" instead of "CIDR
Address" or "IP Address + Netmask"

At the very least, i think the behaviour should coherent. Either pgadmin
accepts faulty lines then it must be able to display them, or
Pgadmin refuses to write a faulty line in the pg_hba.conf and in that
case it's ok hide them...

I think the best behaviour would be :

a/ pgadmin refuses to write a faulty line
b/ pgadmin display faulty lines **in red** (if any)

...which is basically the opposite to what pgAdmin is doing now... :)

Here's more detail :

* Platform : Windows XP and Linux
* Language : French
* Distribution : EDB installer / Ubuntu package / Source
* Version : 1.10.5 and 1.12.2
* nothing in pgadmin.log

--
damien clochard
dalibo.com

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Susanne Ebrecht 2011-01-07 06:47:23 Re: some window sizes are not ok
Previous Message Benjamin Krajmalnik 2011-01-06 16:53:18 What is considered a "slow processes"