Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
michelp committed Aug 28, 2021
1 parent e64dc8a commit a86aef6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ The wheel can be installed with pip:
$ pip install postgresql-wheel
```

Postgres binaries in the package can be found in the directory pointed
to by the `postgresql.pg_bin` global variable. `initdb` and `pg_ctl`
functions are provided for convenience:

```py3
>>> from postgresql import initdb, pg_ctl
>>> initdb('-D testdatabase')
>>> pg_ctl('-D testdatabase -o "-p 5678" -l testdatabase.log start')

>>> import psycopg2
>>> c = psycopg2.connect("postgres://localhost:5678/postgres") # connect with local client
>>> with c.cursor() as q:
>>> q.execute("select version()")
Expand Down

0 comments on commit a86aef6

Please sign in to comment.