mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
d274105942
> > In pg.py the attributes of DB are defined as being the same as > the attributes of the corresponding pgobject "db", using the following ... > The problem is that the attributes of db (which are read only) > are not static (they are actually function calls to PostgreSQL), > especially "status" and "error", but those attributes are copied > and this is done only once when initializing the DB object. > > So, in effect, only the attribute "db.error" of a DB instance > will be updated, but not the attribute "error". Same with "status". > Don't copy the (read only) attributes of the pgobject to the > DB object, but only the methods, and all of them, like this: > > --------------- change in pg.py ------------------ > # Create convience methods, in a way that is still overridable. > for e in self.db.__methods__: > setattr(self, e, getattr(self.db, e)) > ---------------------------------------------------- > > Furthermore, make an addition to the documentation of the > DB wrapper class (i.e. in pygresql-pg-db.html): > After the sentence "All pgobject methods are included in this class also." > add the following sentence "The pgobject read-only attributes can be > accessed py adding the prefix 'db.' to them." Christoph Zwerschke |
||
---|---|---|
config | ||
contrib | ||
doc | ||
src | ||
aclocal.m4 | ||
configure | ||
configure.in | ||
COPYRIGHT | ||
GNUmakefile.in | ||
HISTORY | ||
INSTALL | ||
Makefile | ||
README | ||
register.txt |
PostgreSQL Database Management System ===================================== This directory contains the source code distribution of the PostgreSQL database management system. PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains several language bindings, including C, Perl, Python, and Tcl, as well as a JDBC driver. The ODBC and C++ interfaces have been moved to the PostgreSQL Projects Web Site at http://gborg.postgresql.org for separate maintenance. See the file INSTALL for instructions on how to build and install PostgreSQL. That file also lists supported operating systems and hardware platforms and contains information regarding any other software packages that are required to build or run the PostgreSQL system. Changes between all PostgreSQL releases are recorded in the file HISTORY. Copyright and license information can be found in the file COPYRIGHT. A comprehensive documentation set is included in this distribution; it can be read as described in the installation instructions. The latest version of this software may be obtained at ftp://ftp.postgresql.org/pub/. For more information look at our web site located at http://www.postgresql.org/.