10
10
*
11
11
*
12
12
* IDENTIFICATION
13
- * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.167 2008/09/15 12:32:56 mha Exp $
13
+ * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.168 2008/09/15 20:55:04 mha Exp $
14
14
*
15
15
*-------------------------------------------------------------------------
16
16
*/
@@ -660,8 +660,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
660
660
(errcode (ERRCODE_CONFIG_FILE_ERROR ),
661
661
errmsg ("invalid IP address \"%s\": %s" ,
662
662
token , 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 )));
665
665
if (cidr_slash )
666
666
* cidr_slash = '/' ;
667
667
if (gai_result )
@@ -697,8 +697,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
697
697
(errcode (ERRCODE_CONFIG_FILE_ERROR ),
698
698
errmsg ("invalid IP mask \"%s\": %s" ,
699
699
token , 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 )));
702
702
if (gai_result )
703
703
pg_freeaddrinfo_all (hints .ai_family , gai_result );
704
704
goto hba_other_error ;
@@ -773,8 +773,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
773
773
(errcode (ERRCODE_CONFIG_FILE_ERROR ),
774
774
errmsg ("invalid authentication method \"%s\"" ,
775
775
token ),
776
- errdetail ( "In file \"%s\" line %d " ,
777
- HbaFileName , line_num )));
776
+ errcontext ( "line %d of configuration file \"%s\"" ,
777
+ line_num , HbaFileName )));
778
778
goto hba_other_error ;
779
779
}
780
780
@@ -784,8 +784,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
784
784
(errcode (ERRCODE_CONFIG_FILE_ERROR ),
785
785
errmsg ("invalid authentication method \"%s\": not supported on this platform" ,
786
786
token ),
787
- errdetail ( "In file \"%s\" line %d " ,
788
- HbaFileName , line_num )));
787
+ errcontext ( "line %d of configuration file \"%s\"" ,
788
+ line_num , HbaFileName )));
789
789
goto hba_other_error ;
790
790
}
791
791
@@ -796,8 +796,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
796
796
ereport (LOG ,
797
797
(errcode (ERRCODE_CONFIG_FILE_ERROR ),
798
798
errmsg ("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 )));
801
801
goto hba_other_error ;
802
802
}
803
803
@@ -840,14 +840,16 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
840
840
if (line_item )
841
841
ereport (LOG ,
842
842
(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 )));
846
847
else
847
848
ereport (LOG ,
848
849
(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 )));
851
853
852
854
/* Come here if suitable message already logged */
853
855
hba_other_error :
0 commit comments