aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2009-03-04 08:43:15 +0000
committerMagnus Hagander <magnus@hagander.net>2009-03-04 08:43:15 +0000
commita2e9de79a644359957d1bdd4e02c5613facd9b18 (patch)
tree68674a257fd557efc4a63d1658babdd0ed803aa9 /src
parentfd75329e81b37b8764dff628df761e14736be183 (diff)
downloadpostgresql-a2e9de79a644359957d1bdd4e02c5613facd9b18.tar.gz
postgresql-a2e9de79a644359957d1bdd4e02c5613facd9b18.zip
Log a warning instead of shutting down the system if we can't load
pg_hba.conf on reload (for example due to a permission error). Selena Deckelmann
Diffstat (limited to 'src')
-rw-r--r--src/backend/libpq/hba.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c
index c27e9f990b9..9261d81d53c 100644
--- a/src/backend/libpq/hba.c
+++ b/src/backend/libpq/hba.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.180 2009/01/07 13:09:21 mha Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.181 2009/03/04 08:43:15 mha Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1306,12 +1306,19 @@ load_hba(void)
List *new_parsed_lines = NIL;
file = AllocateFile(HbaFileName, "r");
- /* Failure is fatal since with no HBA entries we can do nothing... */
if (file == NULL)
- ereport(FATAL,
+ {
+ ereport(WARNING,
(errcode_for_file_access(),
errmsg("could not open configuration file \"%s\": %m",
HbaFileName)));
+ /*
+ * Caller will take care of making this a FATAL error in case this is
+ * the initial startup. If it happens on reload, we just keep the
+ * old version around.
+ */
+ return false;
+ }
tokenize_file(HbaFileName, file, &hba_lines, &hba_line_nums);
FreeFile(file);