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

Commit9bf92cf

Browse files
committed
improve README.md
1 parent2f5d2e4 commit9bf92cf

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

‎README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ We encourage you to use `virtualenv` for your testing environment. Both Python 2
2222

2323
>Note: by default testgres runs`initdb`,`pg_ctl`,`psql` provided by`PATH`. To specify a custom postgres installation, set the environment variable`PG_CONFIG` pointing to the`pg_config` executable:`export PG_CONFIG=/path/to/pg_config`.
2424
25+
26+
###Overview
27+
2528
Here is an example of what you can do with`testgres`:
2629

2730
```python
@@ -80,7 +83,7 @@ To stop the server, run:
8083
node.stop()
8184
```
8285

83-
It is essential to clean everything up, so make sure to call`node.cleanup()` once you've finished all of your tests.
86+
###Logging
8487

8588
Nodes support python logging system, so if you have configured logging
8689
in your tests you can use it to redirect postgres logs to yours.
@@ -90,11 +93,22 @@ To do that just use `use_logging` argument like here:
9093
node= testgres.get_new_node('master',use_logging=True)
9194
```
9295

93-
Also youcan find working configurationsample for logging in tests.
96+
Youcan find working configurationexample for logging in`tests/test_simple.py`.
9497

95-
Please see`testgres/tests` directory for replication configuration example.
96-
>Note: you could take a look at[`pg_pathman`](https://github.com/postgrespro/pg_pathman) to get an idea of`testgres`' capabilities.
9798

99+
###Backup & replication
100+
101+
It's quite easy to create a backup and start a new replica:
102+
103+
```python
104+
with testgres.get_new_node('master')as master:
105+
master.init().start()
106+
with master.backup()as backup:
107+
replica= backup.spawn_replica('replica').start()
108+
print(replica.execute('postgres','select 1'))
109+
```
110+
111+
>Note: you could take a look at[`pg_pathman`](https://github.com/postgrespro/pg_pathman) to get an idea of`testgres`' capabilities.
98112
99113
##Authors
100114

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp