Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit718fe0a

Browse files
committed
Make consistent a couple of log messages when parsing HBA files
This commit adjusts two log messages:- When a field in pg_ident.conf is not populated, report the line of theconfiguration file in an error context message instead of the mainentry.- When parsing pg_ident.conf and finding an invalid regexp, add someinformation about the line of the configuration file involved within anerror context message.Author: Julien RouhaudDiscussion:https://postgr.es/m/20220223045959.35ipdsvbxcstrhya@jrouhaud
1 parent47ab1ac commit718fe0a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

‎src/backend/libpq/hba.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -900,8 +900,9 @@ do { \
900900
if (!field) { \
901901
ereport(elevel, \
902902
(errcode(ERRCODE_CONFIG_FILE_ERROR), \
903-
errmsg("missing entry in file \"%s\" at end of line %d", \
904-
IdentFileName, line_num))); \
903+
errmsg("missing entry at end of line"), \
904+
errcontext("line %d of configuration file \"%s\"", \
905+
line_num, IdentFileName))); \
905906
*err_msg = psprintf("missing entry at end of line"); \
906907
return NULL; \
907908
} \
@@ -2372,7 +2373,9 @@ parse_ident_line(TokenizedAuthLine *tok_line, int elevel)
23722373
ereport(elevel,
23732374
(errcode(ERRCODE_INVALID_REGULAR_EXPRESSION),
23742375
errmsg("invalid regular expression \"%s\": %s",
2375-
parsedline->ident_user+1,errstr)));
2376+
parsedline->ident_user+1,errstr),
2377+
errcontext("line %d of configuration file \"%s\"",
2378+
line_num,IdentFileName)));
23762379

23772380
*err_msg=psprintf("invalid regular expression \"%s\": %s",
23782381
parsedline->ident_user+1,errstr);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp