File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -136,10 +136,31 @@ with testgres.get_new_node('master') as master:
136136 print (res)
137137```
138138
139+ ### Custom configuration
140+
141+ It's often useful to extend default configuration provided by ` testgres ` .
142+
143+ ` testgres ` have ` default_conf ` function that helps to control some basic
144+ options. The ` append_conf ` function can be used to add custom
145+ lines to configuration lines:
146+
147+ ``` python
148+ ext_conf = " shared_preload_libraries = 'postgres_fdw'\n "
149+
150+ with testgres.get_new_node(' master' ) as master:
151+ master.default_conf(fsync = True ,
152+ unix_sockets = False ,
153+ allow_streaming = True ,
154+ log_statement = ' all' )
155+ master.append_conf(' postgresql.conf' , ext_conf)
156+ ```
157+
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 ` .
139160
140161## Authors
141162
142- [ Ildar Musin] ( https://github.com/zilder ) <i.musin(at)postgrespro.ru> Postgres Professional Ltd., Russia
143- [ Dmitry Ivanov] ( https://github.com/funbringer ) <d.ivanov(at)postgrespro.ru> Postgres Professional Ltd., Russia
144- [ Ildus Kurbangaliev] ( https://github.com/ildus ) <i.kurbangaliev(at)postgrespro.ru> Postgres Professional Ltd., Russia
163+ [ Ildar Musin] ( https://github.com/zilder ) <i.musin(at)postgrespro.ru> Postgres Professional Ltd., Russia
164+ [ Dmitry Ivanov] ( https://github.com/funbringer ) <d.ivanov(at)postgrespro.ru> Postgres Professional Ltd., Russia
165+ [ Ildus Kurbangaliev] ( https://github.com/ildus ) <i.kurbangaliev(at)postgrespro.ru> Postgres Professional Ltd., Russia
145166[ Yury Zhuravlev] ( https://github.com/stalkerg ) <stalkerg(at)gmail.com>
You can’t perform that action at this time.
0 commit comments