Skip to content

Commit 80d4e00

Browse files
committed
minor fixes in README.md
1 parent f023166 commit 80d4e00

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,27 +136,34 @@ with testgres.get_new_node('master') as master:
136136
print(res)
137137
```
138138

139+
139140
### Custom configuration
140141

141142
It's often useful to extend default configuration provided by `testgres`.
142143

143-
`testgres` have `default_conf` function that helps to control some basic
144-
options. The `append_conf` function can be used to add custom
144+
`testgres` has `default_conf()` function that helps control some basic
145+
options. The `append_conf()` function can be used to add custom
145146
lines to configuration lines:
146147

147148
```python
148-
ext_conf = "shared_preload_libraries = 'postgres_fdw'\n"
149+
ext_conf = "shared_preload_libraries = 'postgres_fdw'"
149150

150-
with testgres.get_new_node('master') as master:
151+
# initialize a new node
152+
with testgres.get_new_node().init() as master:
153+
154+
# ... do something ...
155+
156+
# reset main config file
151157
master.default_conf(fsync=True,
152-
unix_sockets=False,
153-
allow_streaming=True,
154-
log_statement='all')
158+
allow_streaming=True)
159+
160+
# add a new config line
155161
master.append_conf('postgresql.conf', ext_conf)
156162
```
157163

158-
Note that `default_conf` is called by `init` function and the latter overwrites
159-
the configuration file. That means `init` should be called before `append_conf`.
164+
Note that `default_conf()` is called by `init()` function; both of them overwrite
165+
the configuration file, which means that they should be called before `append_conf()`.
166+
160167

161168
## Authors
162169

0 commit comments

Comments
 (0)