1010 *
1111 *
1212 * IDENTIFICATION
13- * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.167 2008/09/1512:32:56 mha Exp $
13+ * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.168 2008/09/1520:55:04 mha Exp $
1414 *
1515 *-------------------------------------------------------------------------
1616 */
@@ -660,8 +660,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
660660(errcode (ERRCODE_CONFIG_FILE_ERROR ),
661661errmsg ("invalid IP address \"%s\": %s" ,
662662token ,gai_strerror (ret )),
663- errdetail ( "In file \"%s\", line %d " ,
664- HbaFileName , line_num )));
663+ errcontext ( "line %d of configuration file \"%s\"" ,
664+ line_num , HbaFileName )));
665665if (cidr_slash )
666666* cidr_slash = '/' ;
667667if (gai_result )
@@ -697,8 +697,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
697697(errcode (ERRCODE_CONFIG_FILE_ERROR ),
698698errmsg ("invalid IP mask \"%s\": %s" ,
699699token ,gai_strerror (ret )),
700- errdetail ( "In file \"%s\", line %d " ,
701- HbaFileName , line_num )));
700+ errcontext ( "line %d of configuration file \"%s\"" ,
701+ line_num , HbaFileName )));
702702if (gai_result )
703703pg_freeaddrinfo_all (hints .ai_family ,gai_result );
704704gotohba_other_error ;
@@ -773,8 +773,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
773773(errcode (ERRCODE_CONFIG_FILE_ERROR ),
774774errmsg ("invalid authentication method \"%s\"" ,
775775token ),
776- errdetail ( "In file \"%s\" line %d " ,
777- HbaFileName , line_num )));
776+ errcontext ( "line %d of configuration file \"%s\"" ,
777+ line_num , HbaFileName )));
778778gotohba_other_error ;
779779}
780780
@@ -784,8 +784,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
784784(errcode (ERRCODE_CONFIG_FILE_ERROR ),
785785errmsg ("invalid authentication method \"%s\": not supported on this platform" ,
786786token ),
787- errdetail ( "In file \"%s\" line %d " ,
788- HbaFileName , line_num )));
787+ errcontext ( "line %d of configuration file \"%s\"" ,
788+ line_num , HbaFileName )));
789789gotohba_other_error ;
790790}
791791
@@ -796,8 +796,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
796796ereport (LOG ,
797797(errcode (ERRCODE_CONFIG_FILE_ERROR ),
798798errmsg ("krb5 authentication is not supported on local sockets" ),
799- errdetail ( "In file \"%s\" line %d " ,
800- HbaFileName , line_num )));
799+ errcontext ( "line %d of configuration file \"%s\"" ,
800+ line_num , HbaFileName )));
801801gotohba_other_error ;
802802}
803803
@@ -840,14 +840,16 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
840840if (line_item )
841841ereport (LOG ,
842842(errcode (ERRCODE_CONFIG_FILE_ERROR ),
843- errmsg ("invalid entry in file \"%s\" at line %d, token \"%s\"" ,
844- HbaFileName ,line_num ,
845- (char * )lfirst (line_item ))));
843+ errmsg ("invalid token \"%s\"" ,
844+ (char * )lfirst (line_item )),
845+ errcontext ("line %d of configuration file \"%s\"" ,
846+ line_num ,HbaFileName )));
846847else
847848ereport (LOG ,
848849(errcode (ERRCODE_CONFIG_FILE_ERROR ),
849- errmsg ("missing field in file \"%s\" at end of line %d" ,
850- HbaFileName ,line_num )));
850+ errmsg ("missing field at end of line" ),
851+ errcontext ("line %d of configuration file \"%s\"" ,
852+ line_num ,HbaFileName )));
851853
852854/* Come here if suitable message already logged */
853855hba_other_error :