Skip to content

Commit e11aa15

Browse files
author
James William Pye
committed
Update long_description.
1 parent 1979d70 commit e11aa15

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

postgresql/release/distutils.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
Sample PG-API Code
2929
------------------
3030
31-
>>> import postresql.driver as pg_driver
32-
>>> db = pg_driver.connect(user = 'mydbuser', host = 'localhost', port = 5432, database = 'mydbname')
31+
>>> import postresql
32+
>>> db = postgresql.open('pq://user:password@host:port/database')
3333
>>> db.execute("CREATE TABLE emp (emp_first_name text, emp_last_name text, emp_salary numeric)")
3434
>>> make_emp = db.prepare("INSERT INTO emp VALUES ($1, $2, $3)")
3535
>>> make_emp("John", "Doe", "75,322")
@@ -46,10 +46,11 @@
4646
4747
Once you get it installed, try out the ``pg_python`` command::
4848
49-
$ pg_python -h localhost -U theuser -d database_name
49+
$ pg_python -h localhost -p port -U theuser -d database_name
50+
51+
If a successful connection is made to the remote host, it will provide a Python
52+
console with the database connection bound to the `db` name.
5053
51-
That should give you a Python console with the database connection bound to the
52-
`db` name.
5354
5455
History
5556
-------

0 commit comments

Comments
 (0)