Skip to content

Commit 24aa4ea

Browse files
committed
update README.md
1 parent 9cc5639 commit 24aa4ea

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ node.start()
9696

9797
Finally, our temporary cluster is able to process queries. There are four ways to run them:
9898

99-
| Command | Description |
100-
|-------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
101-
| `node.psql(database, query)` | Runs query via `psql` command and returns tuple `(error code, stdout, stderr)`. |
102-
| `node.safe_psql(database, query)` | Same as `psql()` except that it returns only `stdout`. If an error occures during the execution, an exception will be thrown. |
103-
| `node.execute(database, query, username=None, commit=True)` | Connects to PostgreSQL using `psycopg2` or `pg8000` (depends on which one is installed in your system) and returns two-dimensional array with data. |
104-
| `node.connect(database='postgres')` | Returns connection wrapper (`NodeConnection`) capable of running several queries within a single transaction. |
99+
| Command | Description |
100+
|----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
101+
| `node.psql(dbname, query)` | Runs query via `psql` command and returns tuple `(error code, stdout, stderr)`. |
102+
| `node.safe_psql(dbname, query)` | Same as `psql()` except that it returns only `stdout`. If an error occures during the execution, an exception will be thrown. |
103+
| `node.execute(dbname, query)` | Connects to PostgreSQL using `psycopg2` or `pg8000` (depends on which one is installed in your system) and returns two-dimensional array with data. |
104+
| `node.connect(dbname, username)` | Returns connection wrapper (`NodeConnection`) capable of running several queries within a single transaction. |
105105

106106
The last one is the most powerful: you can use `begin(isolation_level)`, `commit()` and `rollback()`:
107107
```python
@@ -127,6 +127,7 @@ with testgres.get_new_node('master') as master:
127127
master.init().start()
128128
with master.backup() as backup:
129129
replica = backup.spawn_replica('replica').start()
130+
replica.catchup() # catch up with master
130131
print(replica.execute('postgres', 'select 1'))
131132
```
132133

0 commit comments

Comments
 (0)