source: trunk/docs/contents/changelog.rst @ 841

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

Add type helper for UUIDs

  • Property svn:keywords set to Author Date Id Revision
File size: 23.4 KB
Line 
1ChangeLog
2=========
3
4Version 5.0
5-----------
6- This version now runs on both Python 2 and Python 3.
7- The supported versions are Python 2.6 to 2.7, and 3.3 to 3.5.
8- PostgreSQL is supported in all versions from 9.0 to 9.5.
9- Changes in the classic PyGreSQL module (pg):
10    - The classic interface got two new methods get_as_list() and get_as_dict()
11      returning a database table as a Python list or dict. The amount of data
12      returned can be controlled with various parameters.
13    - A method upsert() has been added to the DB wrapper class that utilitses
14      the "upsert" feature that is new in PostgreSQL 9.5. The new method nicely
15      complements the existing get/insert/update/delete() methods.
16    - When using insert/update/upsert(), you can now pass PostgreSQL arrays as
17      lists and PostgreSQL records as tuples in the classic module.
18    - Conversely, when the query method returns a PostgreSQL array, it is passed
19      to Python as a list. PostgreSQL records are converted to named tuples as
20      well, but only if you use one of the get/insert/update/delete() methods.
21      PyGreSQL uses a new fast built-in parser to achieve this.  The automatic
22      conversion of arrays to lists can be disabled with set_array(False).
23    - The pkey() method of the classic interface now returns tuples instead
24      of frozenset. The order of the tuples is like in the primary key index.
25    - Like the DB-API 2 module, the classic module now also returns bool values
26      from the database as Python bool objects instead of strings.  You can
27      still restore the old behavior by calling set_bool(False).
28    - Like the DB-API 2 module, the classic module now also returns bytea
29      data fetched from the database as byte strings, so you don't need to
30      call unescape_bytea() any more.  This has been made configurable though,
31      and you can restore the old behavior by calling set_bytea_escaped(True).
32    - A method set_jsondecode() has been added for changing or removing the
33      function that automatically decodes JSON data coming from the database.
34      By default, decoding JSON is now enabled and uses the decoder function
35      in the standard library with its default parameters.
36    - The table name that is affixed to the name of the OID column returned
37      by the get() method of the classic interface will not automatically
38      be fully qualified any more. This reduces overhead from the interface,
39      but it means you must always write the table name in the same way when
40      you call the methods using it and you are using tables with OIDs.
41      Also, OIDs are now only used when access via primary key is not possible.
42      Note that OIDs are considered deprecated anyway, and they are not created
43      by default any more in PostgreSQL 8.1 and later.
44    - The internal caching and automatic quoting of class names in the classic
45      interface has been simplified and improved, it should now perform better
46      and use less memory. Also, overhead for quoting values in the DB wrapper
47      methods has been reduced and security has been improved by passing the
48      values to libpq separately as parameters instead of inline.
49    - It is now possible to use regular type names instead of the simpler
50      type names that are used by default in PyGreSQL, without breaking any
51      of the mechanisms for quoting and typecasting, which rely on the type
52      information. This is achieved while maintaining simplicity and backward
53      compatibility by augmenting the type name string objects with all the
54      necessary information under the cover. To switch regular type names on
55      or off (this is the default), call the DB wrapper method use_regtypes().
56    - A new method query_formatted() has been added to the DB wrapper class
57      that allows using the format specifications from Python.  A flag "inline"
58      can be set to specify whether parameters should be sent to the database
59      separately or formatted into the SQL.
60    - A new type helper Bytea() has been added.
61- Changes in the DB-API 2 module (pgdb):
62    - The DB-API 2 module now always returns result rows as named tuples
63      instead of simply lists as before. The documentation explains how
64      you can restore the old behavior or use custom row objects instead.
65    - The names of the various classes used by the classic and DB-API 2
66      modules have been renamed to become simpler, more intuitive and in
67      line with the names used in the DB-API 2 documentation.
68      Since the API provides only objects of these types through constructor
69      functions, this should not cause any incompatibilities.
70    - The DB-API 2 module now supports the callproc() cursor method. Note
71      that output parameters are currently not replaced in the return value.
72    - The DB-API 2 module now supports copy operations between data streams
73      on the client and database tables via the COPY command of PostgreSQL.
74      The cursor method copy_from() can be used to copy data from the database
75      to the client, and the cursor method copy_to() can be used to copy data
76      from the client to the database.
77    - The 7-tuples returned by the description attribute of a pgdb cursor
78      are now named tuples, i.e. their elements can be also accessed by name.
79      The column names and types can now also be requested through the
80      colnames and coltypes attributes, which are not part of DB-API 2 though.
81      The type_code provided by the description attribute is still equal to
82      the PostgreSQL internal type name, but now carries some more information
83      in additional attributes. The size, precision and scale information that
84      is part of the description is now properly set for numeric types.
85    - If you pass a Python list as one of the parameters to a DB-API 2 cursor,
86      it is now automatically bound using an ARRAY constructor. If you pass a
87      Python tuple, it is bound using a ROW constructor. This is useful for
88      passing records as well as making use of the IN syntax.
89    - Inversely, when a fetch method of a DB-API 2 cursor returns a PostgreSQL
90      array, it is passed to Python as a list, and when it returns a PostgreSQL
91      composite type, it is passed to Python as a named tuple. PyGreSQL uses
92      a new fast built-in parser to achieve this. Anonymous composite types are
93      also supported, but yield only an ordinary tuple containing text strings.
94    - New type helpers Interval() and Uuid() have been added.
95- Changes concerning both modules:
96    - PyGreSQL now tries to raise more specific and appropriate subclasses of
97      DatabaseError than just ProgrammingError. Particularly, when database
98      constraints are violated, it raises an IntegrityError now.
99    - The modules now provide get_typecast() and set_typecast() methods
100      allowing to control the typecasting on the global level.  The connection
101      objects have got type caches with the same methods which give control
102      over the typecasting on the level of the current connection.
103      See the documentation on details about the type cache and the typecast
104      mechanisms provided by PyGreSQL.
105    - Dates, times, timestamps and time intervals are now returned as the
106      corresponding Python objects from the datetime module of the standard
107      library.  In earlier versions of PyGreSQL they had been returned as
108      strings.  You can restore the old behavior by deactivating the respective
109      typecast functions, e.g. set_typecast('date', None).
110    - PyGreSQL now support the "uuid" data type, converting such columns
111      automatically to and from Python uuid.UUID objects.
112    - PyGreSQL now supports the "hstore" data type, converting such columns
113      automatically to and from Python dictionaries.  If you want to insert
114      Python objects as JSON data using DB-API 2, you should wrap them in the
115      new HStore() type constructor as a hint to PyGreSQL.
116    - PyGreSQL now supports the "json" and "jsonb" data types, converting such
117      columns automatically to and from Python objects. If you want to insert
118      Python objects as JSON data using DB-API 2, you should wrap them in the
119      new Json() type constructor as a hint to PyGreSQL.
120    - A new type helper Literal() for inserting parameters literally as SQL
121      has been added.  This is useful for table names, for instance.
122    - Fast parsers cast_array(), cast_record() and cast_hstore for the input
123      and output syntax for PostgreSQL arrays, composite types and the hstore
124      type have been added to the C extension module. The array parser also
125      allows using multi-dimensional arrays with PyGreSQL.
126    - The tty parameter and attribute of database connections has been
127      removed since it is not supported any more since PostgreSQL 7.4.
128
129Version 4.2 (2016-01-21)
130------------------------
131- The supported Python versions are 2.4 to 2.7.
132- PostgreSQL is supported in all versions from 8.3 to 9.5.
133- Set a better default for the user option "escaping-funcs".
134- Force build to compile with no errors.
135- New methods get_parameters() and set_parameters() in the classic interface
136  which can be used to get or set run-time parameters.
137- New method truncate() in the classic interface that can be used to quickly
138  empty a table or a set of tables.
139- Fix decimal point handling.
140- Add option to return boolean values as bool objects.
141- Add option to return money values as string.
142- get_tables() does not list information schema tables any more.
143- Fix notification handler (Thanks Patrick TJ McPhee).
144- Fix a small issue with large objects.
145- Minor improvements of the NotificationHandler.
146- Converted documentation to Sphinx and added many missing parts.
147- The tutorial files have become a chapter in the documentation.
148- Greatly improved unit testing, tests run with Python 2.4 to 2.7 again.
149
150Version 4.1.1 (2013-01-08)
151--------------------------
152- Add NotificationHandler class and method.  Replaces need for pgnotify.
153- Sharpen test for inserting current_timestamp.
154- Add more quote tests.  False and 0 should evaluate to NULL.
155- More tests - Any number other than 0 is True.
156- Do not use positional parameters internally.
157  This restores backward compatibility with version 4.0.
158- Add methods for changing the decimal point.
159
160Version 4.1 (2013-01-01)
161------------------------
162- Dropped support for Python below 2.5 and PostgreSQL below 8.3.
163- Added support for Python up to 2.7 and PostgreSQL up to 9.2.
164- Particularly, support PQescapeLiteral() and PQescapeIdentifier().
165- The query method of the classic API now supports positional parameters.
166  This an effective way to pass arbitrary or unknown data without worrying
167  about SQL injection or syntax errors (contribution by Patrick TJ McPhee).
168- The classic API now supports a method namedresult() in addition to
169  getresult() and dictresult(), which returns the rows of the result
170  as named tuples if these are supported (Python 2.6 or higher).
171- The classic API has got the new methods begin(), commit(), rollback(),
172  savepoint() and release() for handling transactions.
173- Both classic and DBAPI 2 connections can now be used as context
174  managers for encapsulating transactions.
175- The execute() and executemany() methods now return the cursor object,
176  so you can now write statements like "for row in cursor.execute(...)"
177  (as suggested by Adam Frederick).
178- Binary objects are now automatically escaped and unescaped.
179- Bug in money quoting fixed.  Amounts of $0.00 handled correctly.
180- Proper handling of date and time objects as input.
181- Proper handling of floats with 'nan' or 'inf' values as input.
182- Fixed the set_decimal() function.
183- All DatabaseError instances now have a sqlstate attribute.
184- The getnotify() method can now also return payload strings (#15).
185- Better support for notice processing with the new methods
186  set_notice_receiver() and get_notice_receiver()
187  (as suggested by Michael Filonenko, see #37).
188- Open transactions are rolled back when pgdb connections are closed
189  (as suggested by Peter Harris, see #46).
190- Connections and cursors can now be used with the "with" statement
191  (as suggested by Peter Harris, see #46).
192- New method use_regtypes() that can be called to let getattnames()
193  return regular type names instead of the simplified classic types (#44).
194
195Version 4.0 (2009-01-01)
196------------------------
197- Dropped support for Python below 2.3 and PostgreSQL below 7.4.
198- Improved performance of fetchall() for large result sets
199  by speeding up the type casts (as suggested by Peter Schuller).
200- Exposed exceptions as attributes of the connection object.
201- Exposed connection as attribute of the cursor object.
202- Cursors now support the iteration protocol.
203- Added new method to get parameter settings.
204- Added customizable row_factory as suggested by Simon Pamies.
205- Separated between mandatory and additional type objects.
206- Added keyword args to insert, update and delete methods.
207- Added exception handling for direct copy.
208- Start transactions only when necessary, not after every commit().
209- Release the GIL while making a connection
210  (as suggested by Peter Schuller).
211- If available, use decimal.Decimal for numeric types.
212- Allow DB wrapper to be used with DB-API 2 connections
213  (as suggested by Chris Hilton).
214- Made private attributes of DB wrapper accessible.
215- Dropped dependence on mx.DateTime module.
216- Support for PQescapeStringConn() and PQescapeByteaConn();
217  these are now also used by the internal _quote() functions.
218- Added 'int8' to INTEGER types. New SMALLINT type.
219- Added a way to find the number of rows affected by a query()
220  with the classic pg module by returning it as a string.
221  For single inserts, query() still returns the oid as an integer.
222  The pgdb module already provides the "rowcount" cursor attribute
223  for the same purpose.
224- Improved getnotify() by calling PQconsumeInput() instead of
225  submitting an empty command.
226- Removed compatibility code for old OID munging style.
227- The insert() and update() methods now use the "returning" clause
228  if possible to get all changed values, and they also check in advance
229  whether a subsequent select is possible, so that ongoing transactions
230  won't break if there is no select privilege.
231- Added "protocol_version" and "server_version" attributes.
232- Revived the "user" attribute.
233- The pg module now works correctly with composite primary keys;
234  these are represented as frozensets.
235- Removed the undocumented and actually unnecessary "view" parameter
236  from the get() method.
237- get() raises a nicer ProgrammingError instead of a KeyError
238  if no primary key was found.
239- delete() now also works based on the primary key if no oid available
240  and returns whether the row existed or not.
241
242Version 3.8.1 (2006-06-05)
243--------------------------
244- Use string methods instead of deprecated string functions.
245- Only use SQL-standard way of escaping quotes.
246- Added the functions escape_string() and escape/unescape_bytea()
247  (as suggested by Charlie Dyson and Kavous Bojnourdi a long time ago).
248- Reverted code in clear() method that set date to current.
249- Added code for backwards compatibility in OID munging code.
250- Reorder attnames tests so that "interval" is checked for before "int."
251- If caller supplies key dictionary, make sure that all has a namespace.
252
253Version 3.8 (2006-02-17)
254------------------------
255- Installed new favicon.ico from Matthew Sporleder <mspo@mspo.com>
256- Replaced snprintf by PyOS_snprintf.
257- Removed NO_SNPRINTF switch which is not needed any longer
258- Clean up some variable names and namespace
259- Add get_relations() method to get any type of relation
260- Rewrite get_tables() to use get_relations()
261- Use new method in get_attnames method to get attributes of views as well
262- Add Binary type
263- Number of rows is now -1 after executing no-result statements
264- Fix some number handling
265- Non-simple types do not raise an error any more
266- Improvements to documentation framework
267- Take into account that nowadays not every table must have an oid column
268- Simplification and improvement of the inserttable() function
269- Fix up unit tests
270- The usual assortment of minor fixes and enhancements
271
272Version 3.7 (2005-09-07)
273------------------------
274Improvement of pgdb module:
275
276- Use Python standard `datetime` if `mxDateTime` is not available
277
278Major improvements and clean-up in classic pg module:
279
280- All members of the underlying connection directly available in `DB`
281- Fixes to quoting function
282- Add checks for valid database connection to methods
283- Improved namespace support, handle `search_path` correctly
284- Removed old dust and unnessesary imports, added docstrings
285- Internal sql statements as one-liners, smoothed out ugly code
286
287Version 3.6.2 (2005-02-23)
288--------------------------
289- Further fixes to namespace handling
290
291Version 3.6.1 (2005-01-11)
292--------------------------
293- Fixes to namespace handling
294
295Version 3.6 (2004-12-17)
296------------------------
297- Better DB-API 2.0 compliance
298- Exception hierarchy moved into C module and made available to both APIs
299- Fix error in update method that caused false exceptions
300- Moved to standard exception hierarchy in classic API
301- Added new method to get transaction state
302- Use proper Python constants where appropriate
303- Use Python versions of strtol, etc. Allows Win32 build.
304- Bug fixes and cleanups
305
306Version 3.5 (2004-08-29)
307------------------------
308Fixes and enhancements:
309
310- Add interval to list of data types
311- fix up method wrapping especially close()
312- retry pkeys once if table missing in case it was just added
313- wrap query method separately to handle debug better
314- use isinstance instead of type
315- fix free/PQfreemem issue - finally
316- miscellaneous cleanups and formatting
317
318Version 3.4 (2004-06-02)
319------------------------
320Some cleanups and fixes.
321This is the first version where PyGreSQL is moved back out of the
322PostgreSQL tree. A lot of the changes mentioned below were actually
323made while in the PostgreSQL tree since their last release.
324
325- Allow for larger integer returns
326- Return proper strings for true and false
327- Cleanup convenience method creation
328- Enhance debugging method
329- Add reopen method
330- Allow programs to preload field names for speedup
331- Move OID handling so that it returns long instead of int
332- Miscellaneous cleanups and formatting
333
334Version 3.3 (2001-12-03)
335------------------------
336A few cleanups.  Mostly there was some confusion about the latest version
337and so I am bumping the number to keep it straight.
338
339- Added NUMERICOID to list of returned types. This fixes a bug when
340  returning aggregates in the latest version of PostgreSQL.
341
342Version 3.2 (2001-06-20)
343------------------------
344Note that there are very few changes to PyGreSQL between 3.1 and 3.2.
345The main reason for the release is the move into the PostgreSQL
346development tree.  Even the WIN32 changes are pretty minor.
347
348- Add Win32 support (gerhard@bigfoot.de)
349- Fix some DB-API quoting problems (niall.smart@ebeon.com)
350- Moved development into PostgreSQL development tree.
351
352Version 3.1 (2000-11-06)
353------------------------
354- Fix some quoting functions.  In particular handle NULLs better.
355- Use a method to add primary key information rather than direct
356  manipulation of the class structures
357- Break decimal out in `_quote` (in pg.py) and treat it as float
358- Treat timestamp like date for quoting purposes
359- Remove a redundant SELECT from the `get` method speeding it,
360  and `insert` (since it calls `get`) up a little.
361- Add test for BOOL type in typecast method to `pgdbTypeCache` class
362  (tv@beamnet.de)
363- Fix pgdb.py to send port as integer to lower level function
364  (dildog@l0pht.com)
365- Change pg.py to speed up some operations
366- Allow updates on tables with no primary keys
367
368Version 3.0 (2000-05-30)
369------------------------
370- Remove strlen() call from pglarge_write() and get size from object
371  (Richard@Bouska.cz)
372- Add a little more error checking to the quote function in the wrapper
373- Add extra checking in `_quote` function
374- Wrap query in pg.py for debugging
375- Add DB-API 2.0 support to pgmodule.c (andre@via.ecp.fr)
376- Add DB-API 2.0 wrapper pgdb.py (andre@via.ecp.fr)
377- Correct keyword clash (temp) in tutorial
378- Clean up layout of tutorial
379- Return NULL values as None (rlawrence@lastfoot.com)
380  (WARNING: This will cause backwards compatibility issues)
381- Change None to NULL in insert and update
382- Change hash-bang lines to use /usr/bin/env
383- Clearing date should be blank (NULL) not TODAY
384- Quote backslashes in strings in `_quote` (brian@CSUA.Berkeley.EDU)
385- Expanded and clarified build instructions (tbryan@starship.python.net)
386- Make code thread safe (Jerome.Alet@unice.fr)
387- Add README.distutils (mwa@gate.net & jeremy@cnri.reston.va.us)
388- Many fixes and increased DB-API compliance by chifungfan@yahoo.com,
389  tony@printra.net, jeremy@alum.mit.edu and others to get the final
390  version ready to release.
391
392Version 2.4 (1999-06-15)
393------------------------
394- Insert returns None if the user doesn't have select permissions
395  on the table.  It can (and does) happen that one has insert but
396  not select permissions on a table.
397- Added ntuples() method to query object (brit@druid.net)
398- Corrected a bug related to getresult() and the money type
399- Corrected a bug related to negative money amounts
400- Allow update based on primary key if munged oid not available and
401  table has a primary key
402- Add many __doc__ strings (andre@via.ecp.fr)
403- Get method works with views if key specified
404
405Version 2.3 (1999-04-17)
406------------------------
407- connect.host returns "localhost" when connected to Unix socket
408  (torppa@tuhnu.cutery.fi)
409- Use `PyArg_ParseTupleAndKeywords` in connect() (torppa@tuhnu.cutery.fi)
410- fixes and cleanups (torppa@tuhnu.cutery.fi)
411- Fixed memory leak in dictresult() (terekhov@emc.com)
412- Deprecated pgext.py - functionality now in pg.py
413- More cleanups to the tutorial
414- Added fileno() method - terekhov@emc.com (Mikhail Terekhov)
415- added money type to quoting function
416- Compiles cleanly with more warnings turned on
417- Returns PostgreSQL error message on error
418- Init accepts keywords (Jarkko Torppa)
419- Convenience functions can be overridden (Jarkko Torppa)
420- added close() method
421
422Version 2.2 (1998-12-21)
423------------------------
424- Added user and password support thanks to Ng Pheng Siong (ngps@post1.com)
425- Insert queries return the inserted oid
426- Add new `pg` wrapper (C module renamed to _pg)
427- Wrapped database connection in a class
428- Cleaned up some of the tutorial.  (More work needed.)
429- Added `version` and `__version__`.
430  Thanks to thilo@eevolute.com for the suggestion.
431
432Version 2.1 (1998-03-07)
433------------------------
434- return fields as proper Python objects for field type
435- Cleaned up pgext.py
436- Added dictresult method
437
438Version 2.0  (1997-12-23)
439-------------------------
440- Updated code for PostgreSQL 6.2.1 and Python 1.5
441- Reformatted code and converted to use full ANSI style prototypes
442- Changed name to PyGreSQL (from PyGres95)
443- Changed order of arguments to connect function
444- Created new type `pgqueryobject` and moved certain methods to it
445- Added a print function for pgqueryobject
446- Various code changes - mostly stylistic
447
448Version 1.0b (1995-11-04)
449-------------------------
450- Keyword support for connect function moved from library file to C code
451  and taken away from library
452- Rewrote documentation
453- Bug fix in connect function
454- Enhancements in large objects interface methods
455
456Version 1.0a (1995-10-30)
457-------------------------
458A limited release.
459
460- Module adapted to standard Python syntax
461- Keyword support for connect function in library file
462- Rewrote default parameters interface (internal use of strings)
463- Fixed minor bugs in module interface
464- Redefinition of error messages
465
466Version 0.9b (1995-10-10)
467-------------------------
468The first public release.
469
470- Large objects implementation
471- Many bug fixes, enhancements, ...
472
473Version 0.1a (1995-10-07)
474-------------------------
475- Basic libpq functions (SQL access)
Note: See TracBrowser for help on using the repository browser.