- Notifications
You must be signed in to change notification settings - Fork37
Add PostgresNode.__repr__() method#44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -7,27 +7,27 @@ | ||
| edit configuration files, start/stop cluster, execute queries. The | ||
| typical flow may look like: | ||
| >>> with get_new_node('test') as node: | ||
| ||
| ... node.init().start() | ||
| ... result = node.safe_psql('postgres', 'select 1') | ||
| ... print(result.decode('utf-8').strip()) | ||
| ... node.stop() | ||
| PostgresNode('test', port=..., base_dir=...) | ||
| ||
| 1 | ||
| PostgresNode('test', port=..., base_dir=...) | ||
| Or: | ||
| >>> with get_new_node('master') as master: | ||
| ... master.init().start() | ||
| ... with master.backup() as backup: | ||
| ... with backup.spawn_replica('replica') as replica: | ||
| ... replica = replica.start() | ||
| ... master.execute('postgres', 'create table test (val int4)') | ||
| ... master.execute('postgres', 'insert into test values (0), (1), (2)') | ||
| ... replica.catchup() # wait until changes are visible | ||
| ... print(replica.execute('postgres', 'select count(*) from test')) | ||
| PostgresNode('master', port=..., base_dir=...) | ||
| [(3,)] | ||
| Copyright (c) 2016, Postgres Professional | ||