source: trunk/docs/changelog.rst @ 681

Last change on this file since 681 was 681, checked in by cito, 4 years ago

Let cursor.description return named tuples

  • Property svn:keywords set to Author Date Id Revision
File size: 15.0 KB
4Version 5.0
6- This version runs on both Python 2 and Python 3.
7- The supported versions are Python 2.6, 2.7, 3.3, 3.4 and 3.5.
8- The supported PostgreSQL versions are 9.0, 9.1, 9.2, 9.3 and 9.4.
9- The names of the various types supported by the classic and DB-API 2
10  modules have been renamed to become simpler, more intuitive and in
11  line with the names used in the DB-API 2 documentation.
12  Since the API provides objects of these types only by the use of
13  constructor functions, this should not cause any incompatibilities.
14- The tty parameter and attribute of database connections has been
15  removed since it is not supported any more since PostgreSQL 7.4.
16- The 7-tuples returned by the description attribute of a pgdb cursor
17  are now named tuples, i.e. their elements can be also accessed by name.
19Version 4.2
21- Set a better default for the user option "escaping-funcs".
22- Force build to compile with no errors.
23- Fix decimal point handling.
24- Add option to return boolean values as bool objects.
25- Add option to return money values as string.
26- Fix notification handler (Thanks Patrick TJ McPhee).
27- Fix a small issue with large objects.
28- Greatly improve unit testing, tests run with Python 2.4 to 2.7 again.
30Version 4.1.1 (2013-01-08)
32- Add WhenNotified class and method.  Replaces need for third party pgnotify.
33- Sharpen test for inserting current_timestamp.
34- Add more quote tests.  False and 0 should evaluate to NULL.
35- More tests - Any number other than 0 is True.
36- Do not use positional parameters internally.
37  This restores backward compatibility with version 4.0.
38- Add methods for changing the decimal point.
40Version 4.1 (2013-01-01)
42- Dropped support for Python below 2.5 and PostgreSQL below 8.3.
43- Added support for Python up to 2.7 and PostgreSQL up to 9.2.
44- Particularly, support PQescapeLiteral() and PQescapeIdentifier().
45- The query method of the classic API now supports positional parameters.
46  This an effective way to pass arbitrary or unknown data without worrying
47  about SQL injection or syntax errors (contribution by Patrick TJ McPhee).
48- The classic API now supports a method namedresult() in addition to
49  getresult() and dictresult(), which returns the rows of the result
50  as named tuples if these are supported (Python 2.6 or higher).
51- The classic API has got the new methods begin(), commit(), rollback(),
52  savepoint() and release() for handling transactions.
53- Both classic and DBAPI 2 connections can now be used as context
54  managers for encapsulating transactions.
55- The execute() and executemany() methods now return the cursor object,
56  so you can now write statements like "for row in cursor.execute(...)"
57  (as suggested by Adam Frederick).
58- Binary objects are now automatically escaped and unescaped.
59- Bug in money quoting fixed.  Amounts of $0.00 handled correctly.
60- Proper handling of date and time objects as input.
61- Proper handling of floats with 'nan' or 'inf' values as input.
62- Fixed the set_decimal() function.
63- All DatabaseError instances now have a sqlstate attribute.
64- The getnotify() method can now also return payload strings (#15).
65- Better support for notice processing with the new methods
66  set_notice_receiver() and get_notice_receiver()
67  (as suggested by Michael Filonenko, see #37).
68- Open transactions are rolled back when pgdb connections are closed
69  (as suggested by Peter Harris, see #46).
70- Connections and cursors can now be used with the "with" statement
71  (as suggested by Peter Harris, see #46).
72- New method use_regtypes() that can be called to let getattnames()
73  return regular type names instead of the simplified classic types (#44).
75Version 4.0 (2009-01-01)
77- Dropped support for Python below 2.3 and PostgreSQL below 7.4.
78- Improved performance of fetchall() for large result sets
79  by speeding up the type casts (as suggested by Peter Schuller).
80- Exposed exceptions as attributes of the connection object.
81- Exposed connection as attribute of the cursor object.
82- Cursors now support the iteration protocol.
83- Added new method to get parameter settings.
84- Added customizable row_factory as suggested by Simon Pamies.
85- Separated between mandatory and additional type objects.
86- Added keyword args to insert, update and delete methods.
87- Added exception handling for direct copy.
88- Start transactions only when necessary, not after every commit().
89- Release the GIL while making a connection
90  (as suggested by Peter Schuller).
91- If available, use decimal.Decimal for numeric types.
92- Allow DB wrapper to be used with DB-API 2 connections
93  (as suggested by Chris Hilton).
94- Made private attributes of DB wrapper accessible.
95- Dropped dependence on mx.DateTime module.
96- Support for PQescapeStringConn() and PQescapeByteaConn();
97  these are now also used by the internal _quote() functions.
98- Added 'int8' to INTEGER types. New SMALLINT type.
99- Added a way to find the number of rows affected by a query()
100  with the classic pg module by returning it as a string.
101  For single inserts, query() still returns the oid as an integer.
102  The pgdb module already provides the "rowcount" cursor attribute
103  for the same purpose.
104- Improved getnotify() by calling PQconsumeInput() instead of
105  submitting an empty command.
106- Removed compatibility code for old OID munging style.
107- The insert() and update() methods now use the "returning" clause
108  if possible to get all changed values, and they also check in advance
109  whether a subsequent select is possible, so that ongoing transactions
110  won't break if there is no select privilege.
111- Added "protocol_version" and "server_version" attributes.
112- Revived the "user" attribute.
113- The pg module now works correctly with composite primary keys;
114  these are represented as frozensets.
115- Removed the undocumented and actually unnecessary "view" parameter
116  from the get() method.
117- get() raises a nicer ProgrammingError instead of a KeyError
118  if no primary key was found.
119- delete() now also works based on the primary key if no oid available
120  and returns whether the row existed or not.
122Version 3.8.1 (2006-06-05)
124- Use string methods instead of deprecated string functions.
125- Only use SQL-standard way of escaping quotes.
126- Added the functions escape_string() and escape/unescape_bytea()
127  (as suggested by Charlie Dyson and Kavous Bojnourdi a long time ago).
128- Reverted code in clear() method that set date to current.
129- Added code for backwards compatibility in OID munging code.
130- Reorder attnames tests so that "interval" is checked for before "int."
131- If caller supplies key dictionary, make sure that all has a namespace.
133Version 3.8 (2006-02-17)
135- Installed new favicon.ico from Matthew Sporleder <>
136- Replaced snprintf by PyOS_snprintf.
137- Removed NO_SNPRINTF switch which is not needed any longer
138- Clean up some variable names and namespace
139- Add get_relations() method to get any type of relation
140- Rewrite get_tables() to use get_relations()
141- Use new method in get_attnames method to get attributes of views as well
142- Add Binary type
143- Number of rows is now -1 after executing no-result statements
144- Fix some number handling
145- Non-simple types do not raise an error any more
146- Improvements to documentation framework
147- Take into account that nowadays not every table must have an oid column
148- Simplification and improvement of the inserttable() function
149- Fix up unit tests
150- The usual assortment of minor fixes and enhancements
152Version 3.7 (2005-09-07)
154Improvement of pgdb module:
156- Use Python standard `datetime` if `mxDateTime` is not available
158Major improvements and clean-up in classic pg module:
160- All members of the underlying connection directly available in `DB`
161- Fixes to quoting function
162- Add checks for valid database connection to methods
163- Improved namespace support, handle `search_path` correctly
164- Removed old dust and unnessesary imports, added docstrings
165- Internal sql statements as one-liners, smoothed out ugly code
167Version 3.6.2 (2005-02-23)
169- Further fixes to namespace handling
171Version 3.6.1 (2005-01-11)
173- Fixes to namespace handling
175Version 3.6 (2004-12-17)
177- Better DB-API 2.0 compliance
178- Exception hierarchy moved into C module and made available to both APIs
179- Fix error in update method that caused false exceptions
180- Moved to standard exception hierarchy in classic API
181- Added new method to get transaction state
182- Use proper Python constants where appropriate
183- Use Python versions of strtol, etc. Allows Win32 build.
184- Bug fixes and cleanups
186Version 3.5 (2004-08-29)
188Fixes and enhancements:
190- Add interval to list of data types
191- fix up method wrapping especially close()
192- retry pkeys once if table missing in case it was just added
193- wrap query method separately to handle debug better
194- use isinstance instead of type
195- fix free/PQfreemem issue - finally
196- miscellaneous cleanups and formatting
198Version 3.4 (2004-06-02)
200Some cleanups and fixes.
201This is the first version where PyGreSQL is moved back out of the
202PostgreSQL tree. A lot of the changes mentioned below were actually
203made while in the PostgreSQL tree since their last release.
205- Allow for larger integer returns
206- Return proper strings for true and false
207- Cleanup convenience method creation
208- Enhance debugging method
209- Add reopen method
210- Allow programs to preload field names for speedup
211- Move OID handling so that it returns long instead of int
212- Miscellaneous cleanups and formatting
214Version 3.3 (2001-12-03)
216A few cleanups.  Mostly there was some confusion about the latest version
217and so I am bumping the number to keep it straight.
219- Added NUMERICOID to list of returned types. This fixes a bug when
220  returning aggregates in the latest version of PostgreSQL.
222Version 3.2 (2001-06-20)
224Note that there are very few changes to PyGreSQL between 3.1 and 3.2.
225The main reason for the release is the move into the PostgreSQL
226development tree.  Even the WIN32 changes are pretty minor.
228- Add Win32 support (
229- Fix some DB-API quoting problems (
230- Moved development into PostgreSQL development tree.
232Version 3.1 (2000-11-06)
234- Fix some quoting functions.  In particular handle NULLs better.
235- Use a method to add primary key information rather than direct
236  manipulation of the class structures
237- Break decimal out in `_quote` (in and treat it as float
238- Treat timestamp like date for quoting purposes
239- Remove a redundant SELECT from the `get` method speeding it,
240  and `insert` (since it calls `get`) up a little.
241- Add test for BOOL type in typecast method to `pgdbTypeCache` class
242  (
243- Fix to send port as integer to lower level function
244  (
245- Change to speed up some operations
246- Allow updates on tables with no primary keys
248Version 3.0 (2000-05-30)
250- Remove strlen() call from pglarge_write() and get size from object
251  (
252- Add a little more error checking to the quote function in the wrapper
253- Add extra checking in `_quote` function
254- Wrap query in for debugging
255- Add DB-API 2.0 support to pgmodule.c (
256- Add DB-API 2.0 wrapper (
257- Correct keyword clash (temp) in tutorial
258- Clean up layout of tutorial
259- Return NULL values as None (
260  (WARNING: This will cause backwards compatibility issues)
261- Change None to NULL in insert and update
262- Change hash-bang lines to use /usr/bin/env
263- Clearing date should be blank (NULL) not TODAY
264- Quote backslashes in strings in `_quote` (brian@CSUA.Berkeley.EDU)
265- Expanded and clarified build instructions (
266- Make code thread safe (
267- Add README.distutils ( &
268- Many fixes and increased DB-API compliance by,
269, and others to get the final
270  version ready to release.
272Version 2.4 (1999-06-15)
274- Insert returns None if the user doesn't have select permissions
275  on the table.  It can (and does) happen that one has insert but
276  not select permissions on a table.
277- Added ntuples() method to query object (
278- Corrected a bug related to getresult() and the money type
279- Corrected a bug related to negative money amounts
280- Allow update based on primary key if munged oid not available and
281  table has a primary key
282- Add many __doc__ strings (
283- Get method works with views if key specified
285Version 2.3 (1999-04-17)
287- returns "localhost" when connected to Unix socket
288  (
289- Use `PyArg_ParseTupleAndKeywords` in connect() (
290- fixes and cleanups (
291- Fixed memory leak in dictresult() (
292- Deprecated - functionality now in
293- More cleanups to the tutorial
294- Added fileno() method - (Mikhail Terekhov)
295- added money type to quoting function
296- Compiles cleanly with more warnings turned on
297- Returns PostgreSQL error message on error
298- Init accepts keywords (Jarkko Torppa)
299- Convenience functions can be overridden (Jarkko Torppa)
300- added close() method
302Version 2.2 (1998-12-21)
304- Added user and password support thanks to Ng Pheng Siong (
305- Insert queries return the inserted oid
306- Add new `pg` wrapper (C module renamed to _pg)
307- Wrapped database connection in a class
308- Cleaned up some of the tutorial.  (More work needed.)
309- Added `version` and `__version__`.
310  Thanks to for the suggestion.
312Version 2.1 (1998-03-07)
314- return fields as proper Python objects for field type
315- Cleaned up
316- Added dictresult method
318Version 2.0  (1997-12-23)
320- Updated code for PostgreSQL 6.2.1 and Python 1.5
321- Reformatted code and converted to use full ANSI style prototypes
322- Changed name to PyGreSQL (from PyGres95)
323- Changed order of arguments to connect function
324- Created new type `pgqueryobject` and moved certain methods to it
325- Added a print function for pgqueryobject
326- Various code changes - mostly stylistic
328Version 1.0b (1995-11-04)
330- Keyword support for connect function moved from library file to C code
331  and taken away from library
332- Rewrote documentation
333- Bug fix in connect function
334- Enhancements in large objects interface methods
336Version 1.0a (1995-10-30)
338A limited release.
340- Module adapted to standard Python syntax
341- Keyword support for connect function in library file
342- Rewrote default parameters interface (internal use of strings)
343- Fixed minor bugs in module interface
344- Redefinition of error messages
346Version 0.9b (1995-10-10)
348The first public release.
350- Large objects implementation
351- Many bug fixes, enhancements, ...
353Version 0.1a (1995-10-07)
355- Basic libpq functions (SQL access)
Note: See TracBrowser for help on using the repository browser.