pgadmin-org / pgadmin3

Archive of the pgAdmin III project
https://www.pgadmin.org/
Other
178 stars 82 forks source link

pg_hba.conf editor is buggy (RM #542) #312

Closed dpage closed 2 years ago

dpage commented 13 years ago

Issue migrated from Redmine: https://redmine.postgresql.org/issues/542 Originally created by Anonymous at 2011-01-09 22:45:49 UTC.

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

dpage commented 13 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/542#note-1 Originally created by Guillaume Lelarge at 2011-07-17 15:14:53 UTC.

It would be pretty hard to find invalid lines, so we don't do that. We now show every uncommented lines (except the empty ones).

Redmine ticket header update:

Name Old Value New Value
Status changed New Resolved
Resolution changed fixed
dpage commented 2 years ago

Issue closed on Redmine.