|
1 | 1 |
|
2 | | -PyGreSQL - v2.3: PostgreSQL module for Python |
| 2 | +PyGreSQL - v2.4: PostgreSQL module for Python |
3 | 3 | ============================================== |
4 | 4 |
|
5 | 5 | 0. Copyright notice |
6 | 6 | =================== |
7 | 7 |
|
8 | | - PyGreSQL, version 2.3 |
| 8 | + PyGreSQL, version 2.4 |
9 | 9 | A Python interface for PostgreSQL database. |
10 | 10 | Written by D'Arcy J.M. Cain, darcy@druid.net<BR> |
11 | 11 | Based heavily on code written by Pascal Andre, andre@chimay.via.ecp.fr. |
@@ -129,12 +129,13 @@ style prototypes and changed the order of arguments to connect. |
129 | 129 |
|
130 | 130 | The home sites of the different packages are: |
131 | 131 |
|
132 | | - - Python:ftp://ftp.python.org:/pub/python |
133 | | - - PosgreSQL:ftp://ftp.PostgreSQL.org/pub/postgresql-6.4.tar.gz |
134 | | - - PyGreSQL:ftp://ftp.druid.net/pub/distrib/pygresql-2.2.tgz |
| 132 | + - Python:http://www.python.org/ |
| 133 | + - PosgreSQL:http://www.PostgreSQL.org/ |
| 134 | + - PyGreSQL:http://www.druid.net/pygresql/ |
135 | 135 |
|
136 | 136 | A Linux RPM can be picked up from ftp://www.eevolute.com/pub/python/. |
137 | | - |
| 137 | +A NetBSD package thould be in the distribution soon and is available |
| 138 | +at ftp://ftp.druid.net/pub/distrib/pygresql.pkg.tgz. |
138 | 139 |
|
139 | 140 | 1.5. Information and support |
140 | 141 | ---------------------------- |
@@ -164,6 +165,10 @@ and all the requests to the database, the pglargeobject that handles |
164 | 165 | all the accesses to Postgres large objects and pgqueryobject that handles |
165 | 166 | query results. |
166 | 167 |
|
| 168 | +If you want to see a simple example of the use of some of these functions, |
| 169 | +see http://www.druid.net/rides/ where I have a link at the bottom to the |
| 170 | +actual Python code for the page. |
| 171 | + |
167 | 172 | 2.1. pg module description |
168 | 173 | ---------------------------- |
169 | 174 |
|
@@ -471,6 +476,16 @@ methods are specified by the tag [LO]. |
471 | 476 | type, using a hardcoded table definition. The number returned is the |
472 | 477 | field rank in the result values list. |
473 | 478 |
|
| 479 | + 2.2.1.5 ntuples - return number of tuples in query object |
| 480 | + --------------------------------------------------------- |
| 481 | + |
| 482 | + Syntax: ntuples() |
| 483 | + Parameters: None |
| 484 | + Return type: integer |
| 485 | + Description: |
| 486 | + This method returns the number of tuples found in a query. |
| 487 | + |
| 488 | + |
474 | 489 | 2.2.2. reset - resets the connection |
475 | 490 | ------------------------------------ |
476 | 491 |
|
@@ -847,25 +862,7 @@ The following describes the methods and variables of this class. |
847 | 862 | Name of field which is the primary key of the table. |
848 | 863 | Description: |
849 | 864 | This method returns the primary key of a table. Note that this raises |
850 | | - an exception if the table doesn't have a primary key. Further, in the |
851 | | - currently released implementation of PostgreSQL the 'PRIMARY KEY' syntax |
852 | | - doesn't actually fill in the necessary tables to determine primary keys. |
853 | | - You can do this yourself with the following query. |
854 | | - |
855 | | -# Set up table and primary_field variables... |
856 | | - |
857 | | - """UPDATE pg_index SET indisprimary = 't' |
858 | | - WHERE pg_index.oid in (SELECT pg_index.oid |
859 | | - FROM pg_class, pg_attribute, pg_index |
860 | | - WHERE pg_class.oid = pg_attribute.attrelid AND |
861 | | - pg_class.oid = pg_index.indrelid AND |
862 | | - pg_index.indkey[0] = pg_attribute.attnum AND |
863 | | - pg_class.relname = '%(table)s' AND |
864 | | - pg_attribute.attname = '%(primary_field)');""" % locals() |
865 | | - |
866 | | - This will be fixed in the upcoming 6.5 release of PostgreSQL or |
867 | | - you can download the current sources now. Downloading current |
868 | | - is, as usual, at your own risk. |
| 865 | + an exception if the table doesn't have a primary key. |
869 | 866 |
|
870 | 867 | 3.3. get_databases - get list of databases in the system |
871 | 868 | -------------------------------------------------------- |
|