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

Commita937b07

Browse files
committed
Add example for replication in pg_hba.conf
Selena Deckelmann
1 parent74aaa21 commita937b07

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

‎src/backend/libpq/pg_hba.conf.sample

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
# plain TCP/IP socket.
2323
#
2424
# DATABASE can be "all", "sameuser", "samerole", "replication", a
25-
# database name, or a comma-separated list thereof.
25+
# database name, or a comma-separated list thereof. The "all"
26+
# keyword does not match "replication". Access to replication
27+
# must be enabled in a separate record (see example below).
2628
#
2729
# USER can be "all", a user name, a group name prefixed with "+", or a
2830
# comma-separated list thereof. In both the DATABASE and USER fields
@@ -80,3 +82,7 @@
8082
host all all 127.0.0.1/32 @authmethod@
8183
# IPv6 local connections:
8284
host all all ::1/128 @authmethod@
85+
# Allow replication connections from localhost, by a user with the
86+
# replication privilege.
87+
# host replication @default_username@ 127.0.0.1/32 @authmethod@
88+
# host replication @default_username@ ::1/128 @authmethod@

‎src/bin/initdb/initdb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,11 @@ setup_config(void)
10861086
"@authcomment@",
10871087
strcmp(authmethod,"trust") ?"" :AUTHTRUST_WARNING);
10881088

1089+
/* Replace username for replication */
1090+
conflines=replace_token(conflines,
1091+
"@default_username@",
1092+
username);
1093+
10891094
snprintf(path,sizeof(path),"%s/pg_hba.conf",pg_data);
10901095

10911096
writefile(path,conflines);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp