PyGreSQL ChangeLog
- Dropped support for Python below 2.3 and PostgreSQL below 7.4.
- Improved performance of fetchall() for large result sets
by speeding up the type casts (as suggested by Peter Schuller).
- Exposed exceptions as attributes of the connection object.
- Exposed connection as attribute of the cursor object.
- Cursors now support the iteration protocol.
- Added new method to get parameter settings.
- Added customizable row_factory as suggested by Simon Pamies.
- Separated between mandatory and additional type objects.
- Added keyword args to insert, update and delete methods.
- Added exception handling for direct copy.
- Release the GIL while making a connection
(as suggested by Peter Schuller).
- If available, use decimal.Decimal for numeric types.
- Allow DB wrapper to be used with DB-API 2 connections
(as suggested by Chris Hilton).
- Made private attributes of DB wrapper accessible.
- Dropped dependence on mx.DateTime module.
- Support for PQescapeStringConn() and PQescapeByteaConn();
these are now also used by the internal _quote() functions.
- Added 'int8' to INTEGER types. New SMALLINT type.
- Added a way to find the number of rows affected by a query()
with the classic pg module by returning it as a string.
For single inserts, query() still returns the oid as an integer.
The pgdb module already provides the "rowcount" cursor attribute
for the same purpose.
- Improved getnotify() by calling PQconsumeInput() instead of
submitting an empty command.
- Removed compatibility code for old OID munging style.
- The insert() and update() methods now use the "returning" clause
if possible to get all changed values, and they also check in advance
whether a subsequent select is possible, so that ongoing transactions
won't break if there is no select privilege.
- Added "protocol_version" and "server_version" attributes.
- Revived the "user" attribute.
- The pg module now works correctly with composite primary keys;
these are represented as frozensets.
- Removed the undocumented and actually unnecessary "view" parameter
from the get() method.
- get() raises a nicer ProgrammingError instead of a KeyError
if no primary key was found.
- delete() now also works based on the primary key if no oid available
and returns whether the row existed or not.
- Use string methods instead of deprecated string functions.
- Only use SQL-standard way of escaping quotes.
- Added the functions escape_string() and escape/unescape_bytea()
(as suggested by Charlie Dyson and Kavous Bojnourdi a long time ago).
- Reverted code in clear() method that set date to current.
- Added code for backwards compatibility in OID munging code.
- Reorder attnames tests so that "interval" is checked for before "int."
- If caller supplies key dictionary, make sure that all has a namespace.
- Installed new favicon.ico from Matthew Sporleder <mspo@mspo.com>
- Replaced snprintf by PyOS_snprintf.
- Removed NO_SNPRINTF switch which is not needed any longer
- Clean up some variable names and namespace
- Add get_relations() method to get any type of relation
- Rewrite get_tables() to use get_relations()
- Use new method in get_attnames method to get attributes of views as well
- Add Binary type
- Number of rows is now -1 after executing no-result statements
- Fix some number handling
- Non-simple types do not raise an error any more
- Improvements to documentation framework
- Take into account that nowadays not every table must have an oid column
- Simplification and improvement of the inserttable() function
- Fix up unit tests
- The usual assortment of minor fixes and enhancements
Improvement of pgdb module:
- Use Python standard datetime if mxDateTime is not available
Major improvements and clean-up in classic pg module:
- All members of the underlying connection directly available in DB
- Fixes to quoting function
- Add checks for valid database connection to methods
- Improved namespace support, handle search_path correctly
- Removed old dust and unnessesary imports, added docstrings
- Internal sql statements as one-liners, smoothed out ugly code
- Further fixes to namespace handling
- Fixes to namespace handling
- Better DB-API 2.0 compliance
- Exception hierarchy moved into C module and made available to both APIs
- Fix error in update method that caused false exceptions
- Moved to standard exception hierarchy in classic API
- Added new method to get transaction state
- Use proper Python constants where appropriate
- Use Python versions of strtol, etc. Allows Win32 build.
- Bug fixes and cleanups
Fixes and enhancements:
- Add interval to list of data types
- fix up method wrapping especially close()
- retry pkeys once if table missing in case it was just added
- wrap query method separately to handle debug better
- use isinstance instead of type
- fix free/PQfreemem issue - finally
- miscellaneous cleanups and formatting
Some cleanups and fixes.
This is the first version where PyGreSQL is moved back out of the
PostgreSQL tree. A lot of the changes mentioned below were actually
made while in the PostgreSQL tree since their last release.
- Allow for larger integer returns
- Return proper strings for true and false
- Cleanup convenience method creation
- Enhance debugging method
- Add reopen method
- Allow programs to preload field names for speedup
- Move OID handling so that it returns long instead of int
- Miscellaneous cleanups and formatting
A few cleanups. Mostly there was some confusion about the latest version
and so I am bumping the number to keep it straight.
- Added NUMERICOID to list of returned types. This fixes a bug when
returning aggregates in the latest version of PostgreSQL.
Note that there are very few changes to PyGreSQL between 3.1 and 3.2.
The main reason for the release is the move into the PostgreSQL
development tree. Even the WIN32 changes are pretty minor.
- Fix some quoting functions. In particular handle NULLs better.
- Use a method to add primary key information rather than direct
manipulation of the class structures
- Break decimal out in _quote (in pg.py) and treat it as float
- Treat timestamp like date for quoting purposes
- Remove a redundant SELECT from the get method speeding it,
and insert (since it calls get) up a little.
- Add test for BOOL type in typecast method to pgdbTypeCache class
(tv@beamnet.de)
- Fix pgdb.py to send port as integer to lower level function
(dildog@l0pht.com)
- Change pg.py to speed up some operations
- Allow updates on tables with no primary keys
- Insert returns None if the user doesn't have select permissions
on the table. It can (and does) happen that one has insert but
not select permissions on a table.
- Added ntuples() method to query object (brit@druid.net)
- Corrected a bug related to getresult() and the money type
- Corrected a bug related to negative money amounts
- Allow update based on primary key if munged oid not available and
table has a primary key
- Add many __doc__ strings (andre@via.ecp.fr)
- Get method works with views if key specified
- connect.host returns "localhost" when connected to Unix socket
(torppa@tuhnu.cutery.fi)
- Use PyArg_ParseTupleAndKeywords in connect() (torppa@tuhnu.cutery.fi)
- fixes and cleanups (torppa@tuhnu.cutery.fi)
- Fixed memory leak in dictresult() (terekhov@emc.com)
- Deprecated pgext.py - functionality now in pg.py
- More cleanups to the tutorial
- Added fileno() method - terekhov@emc.com (Mikhail Terekhov)
- added money type to quoting function
- Compiles cleanly with more warnings turned on
- Returns PostgreSQL error message on error
- Init accepts keywords (Jarkko Torppa)
- Convenience functions can be overridden (Jarkko Torppa)
- added close() method
- Added user and password support thanks to Ng Pheng Siong (ngps@post1.com)
- Insert queries return the inserted oid
- Add new pg wrapper (C module renamed to _pg)
- Wrapped database connection in a class
- Cleaned up some of the tutorial. (More work needed.)
- Added version and __version__.
Thanks to thilo@eevolute.com for the suggestion.
- return fields as proper Python objects for field type
- Cleaned up pgext.py
- Added dictresult method
- Updated code for PostgreSQL 6.2.1 and Python 1.5
- Reformatted code and converted to use full ANSI style prototypes
- Changed name to PyGreSQL (from PyGres95)
- Changed order of arguments to connect function
- Created new type pgqueryobject and moved certain methods to it
- Added a print function for pgqueryobject
- Various code changes - mostly stylistic
- Keyword support for connect function moved from library file to C code
and taken away from library
- Rewrote documentation
- Bug fix in connect function
- Enhancements in large objects interface methods
A limited release.
- Module adapted to standard Python syntax
- Keyword support for connect function in library file
- Rewrote default parameters interface (internal use of strings)
- Fixed minor bugs in module interface
- Redefinition of error messages
The first public release.
- Large objects implementation
- Many bug fixes, enhancements, ...
- Basic libpq functions (SQL access)