From: Billy G. A. <bal...@us...> - 2003-07-14 21:21:14
|
Update of /cvsroot/pypgsql/pypgsql In directory sc8-pr-cvs1:/tmp/cvs-serv4874 Modified Files: Announce ChangeLog Log Message: 14JUL2003 bga Updated for release 2.4. Index: Announce =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/Announce,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Announce 6 Dec 2002 05:29:37 -0000 1.22 --- Announce 14 Jul 2003 21:21:10 -0000 1.23 *************** *** 1,6 **** ! Announce: pyPgSQL - Version 2.3 is released. =========================================================================== ! pyPgSQL v2.3 has been released. It is available at http://pypgsql.sourceforge.net. --- 1,6 ---- ! Announce: pyPgSQL - Version 2.4 is released. =========================================================================== ! pyPgSQL v2.4 has been released. It is available at http://pypgsql.sourceforge.net. *************** *** 27,206 **** Python: http://www.python.org/ - While there didn't change much under the hood, the build process was - completely rewritten, so pyPgSQL should now build out of the box on most - popular platforms. For you, this means that a "python setup.py build" will - now hopefully just work. And for us, this means we'll have to answer less - boring support questions :-) - - These platforms were tested and will build out of the box (of course, - more testing won't hurt): UnixWare 7/OpenUNIX 8, Windows native, Cgwin, - FreeBSD 4.7, Redhat Linux 7.3, SuSE Linux 7.3, Debian Linux 3.0. - - The build process is also designed to work with these platforms, but - they could not be tested in real life (please do so, if you can!): - Mandrake Linux, NetBSD, OpenBSD, MacOS X. - - If your platform isn't supported out of the box, you can edit a - setup.py file to configure the build process. Patches for - supporting additional platforms are more than welcome. Look into - setup.py for how to do it. - - The other big change is that Gerhard finally gave up on getting more - feedback on his Unicode patch and merged it into the pyPgSQL 2.x line. - Hey, if it did work for Linux 2.4, it can work for us, too <0.7 wink>. - - Using Unicode works like this: - - from pyPgSQL import PgSQL - con = PgSQL.connect(client_encoding=("utf-8", "ignore"), unicode_results=1) - - # where client_encoding are the parameters you normally give to the encode - # method of a Unicode string. unicode_results=1 means pyPgSQL will return - # VARCHAR/CHAR/TEXT fields as Unicode strings instead of byte strings. - - # As I refuse to do any magic, you'll also have to set the client encoding - # for the database manually: - cursor = con.cursor() - cursor.execute("SET CLIENT_ENCODING TO UNICODE") - - # There are other ways to set the client encoding, including setting a - # special environment variable (see PostgreSQL manual), but I recommend - # doing it in code. - - Support for reference cursors was added. Since PostgreSQL 7.2, you could - create cursors in PL/pgSQL and pass a reference to the open cursor back to - the client. PgSQL will now cast those referenced cursors into a Cursor - object that can be used to fetch the results in the cursor. For example - (assuming that mmYearInfo() returns a reference curosr): - - $ python - Python 2.2.2 (#7, Nov 27 2002, 17:10:05) [C] on openunix8 - Type "help", "copyright", "credits" or "license" for more information. - >>> from pyPgSQL import PgSQL - >>> cx = PgSQL.connect(database='esi') - >>> cu = cx.cursor() - >>> cu.callproc('mmYearInfo') - >>> rs = cu.fetchone() - >>> rs - [<pyPgSQL.PgSQL.Cursor instance at 0x818495c>] - >>> c = rs[0] - >>> for i in c.description: - ... print i - ... - ['model_year', varchar, 4, 8, None, None, None, 0] - ['mktg_div_name', varchar, 50, 54, None, None, None, 0] - ['model_desc', varchar, 50, 54, None, None, None, 0] - ['book_types', varchar, 50, 54, None, None, None, 0] - ['vehicle_syskey', integer, 4, 4, None, None, None, 0] - >>> r = c.fetchone() - >>> r - ['2003', 'Buick', 'Century', '1;8;9', 2211] - >>> - --------------------------------------------------------------------------- ChangeLog: =========================================================================== ! Changes since pyPgSQL Version 2.2 ================================= ! The following source code files were added to Version 2.3 of pyPgSQL: ! ! unicode_tests.py - Test suite for the new Unicode support. Merged from ! the Unicode patch. ! ! Changes to setup.py ! ------------------- ! * This file was rewritten entirely so that pyPgSQL now builds out of the box ! on Windows, Cygwin, Debian Linux, Redhat Linux, SuSE Linux, FreeBSD, ! UnixWare 7 and OpenUNIX 8. These are the platforms the new build process has ! been tested on. Untested support is available for Mandrake Linux, NetBSD, ! OpenBSD and MacOS X. Changes to README ----------------- ! * Updates for 2.3. ! * Converted the whole document into reStructuredText, so we ! can easily built a HTML version using docutils (http://docutils.sf.net/). ! ! Changes to README.win32 ! ----------------------- ! * Remove out of date warning about PostgreSQL on win32 ! * Reflected change from windows/ to ports/ ! Changes to PgSQL.py ------------------- ! * Fixed various problems with the PgNumeric constructor and formatting ! routines. ! * Fixed problems with new __setupTransaction function: | ! 1. Made it a method of Connection, not Cursor. ! 2. inTransaction was only set if TransactionLevel was set. ! * Fixed instances where method name was incorrect: ! Connection__gcCursor -> _Connection__gcCursor ! Connection__closeCursor -> _Connection__closeCursor ! * Cleaned up code where there was unneeded references to conn in Connection ! class. | ! * Handle the new '__quote__' method for arrays, too. ! * Still handle '_quote' methods for backwards compatibility. ! * Fixed changed PG_TIMESTAMP oid, added PG_TIMESTAMPTZ and PG_REFCURSOR oids. ! * Reference cursors are now type-casted into cursor objects. ! * Completed the emulation of a String object for the PgBytea and PgOther ! classes. This corrects several problems with PgBytea concerning compari- ! sons, using PgBytea types as keys in dictionaries, etc. ! * Added the __hash__ function to the PgNumeric class. Cleaned up the code ! in PgNumeric class and made some small improvments to it. ! * Added the PgArray class. This is a wrapper around a Python list and is ! used for all PostgreSQL arrays. This change was made so that lists and ! tuples no longer have a special meaning in the Cursor.execute() method. ! * Changed the quoting methods defined in the various classes defining ! PostgreSQL support types to __quote__. ! * Merged the Unicode patch. pyPgSQL now has full Unicode support. ! * Added support for the INTERVAL type. ! * mxDateTime 1.x is no longer supported. Require mxDateTime 2.x and give ! useful error message if import fails. ! * Cosmetic changes: use cmp builtin where appropriate. ! * Fixed typo where PgTypes.__str__ was spelled incorrectly; compare to None ! using "is" operator. ! * Take into account that libpq.PgInt8Type might not be ! available. ! * Convert ROWID to PgInt8 instead of PgInt4 (the original behaviour led to ! overflow errors.) ! * Always set the displaysize field of cursor.description to -1. ! PostgreSQL 7.3 doesn't provide this information any more and it's pretty ! useless nowadays that we've mostly left line printers beyond us. ! Changes to pyPgSQL/__init__.py ! ------------------------------ ! * Register libpq.PgInt8 with copy_reg only if available. Changes to pglargeobject.c -------------------------- ! * Made the 'closed' attribute of PgLargeObject an int instead of a long. ! ! Changes to libpqmodule.c: ! ------------------------- ! * Fixed the changed PG_TIMESTAMP oid, added PG_TIMESTAMPTZ and PG_REFCURSOR ! oids. [Bug #845360] ! * Fixed the format string of ParseTuple in libPQbool_FromInt. ! This closes a bug that appeared on Linux/Alpha (#625121). ! ! Changes to pgversion.c: ! ----------------------- ! * Changed pgversion to recognize release canidate versions of PostgreSQL. ! ! Changes to PgSQL test cases: ! ---------------------------- ! * Updated test cases to allow for changes in PostgreSQL 7.3. ! * Don't check for the obsolete displaysize field in cursor.description. ! Also don't check the backend encoding. ! Multiple files ! -------------- ! The windows/ directory has been moved to a port/ directory. Now we *always* ! use our own version of various string versions instead of special casing for a ! dozen different Windows and Unix platforms. - In order to get the C version of PgInt8Type, it is now required that the - constants LLONG_MAX, LLONG_MIN, ULLONG_MAX and ULLONG_MIN are defined when - including limits.h and that including Python.h defines HAVE_LONG_LONG. - Otherwise, a Python class is used instead. --- 27,119 ---- Python: http://www.python.org/ --------------------------------------------------------------------------- ChangeLog: =========================================================================== ! Changes since pyPgSQL Version 2.3 ================================= ! =-=-=-=-=-=-=-=-=-=-=-=-=- ** IMPORTANT NOTE ** =-=-=-=-=-=-=-=-=-=-=-=-=-= ! NOTE: There is a change to the Connection.binary() function that *could* ! cause existing code to break. Connection.binary() no longer commits ! the transaction used to create the large object. The application ! developer is now responsible for commiting (or rolling back) the ! transaction. ! -=-=-=-=-=-=-=-=-=-=-=-=-= ** IMPORTANT NOTE ** -=-=-=-=-=-=-=-=-=-=-=-=-=- Changes to README ----------------- ! * Updates for 2.4. ! Changes to PgSQL.py ------------------- ! * Applied patch from Laurent Pinchart to allow _quote to correctly process ! objects that are sub-classed from String and Long types. ! * Change the name of the quoting function back to _quote. Variables named ! like __*__ should be restrict to system names. ! * PgTypes is now hashable. repr() of a PgType will now return the repr() ! of the underlying OID. ! * Connection.binary() will now fail if autocommit is enabled. ! * Connection.binary() will no longer commit the transaction after creating ! the large object. The application developer is now responsible for ! commiting (or for rolling back) the transaction [Bug #747525]. ! * Added PG_TIMETZ to the mix [Patch #708013]. ! * Pg_Money will now accept a string as a parameter. ! * PostgreSQL int2, int, int4 will now be cast into Python ints. Int8 will ! be cast into a Python long. Float4, float8, and money types will be ! cast into a Python float. ! * Correct problem with the PgNumeric.__radd__ method. [Bug #694358] ! * Correct problem with conversion of negitive integers (with a given scale ! and precision) to PgNumerics. [Bug #694358] ! * Work around a problem where the precision and scale of a query result ! can be different from the first result in the result set. [Bug #697221] ! * Change the code so that the display length in the cursor.description ! attribute is always None instead of '-1'. ! * Fixed another problem with interval <-> DateTimeDelta casting. ! * Corrected a problem that caused the close of a portal (ie. PostgreSQL ! cursor) to fail. ! * Corrected a problem with interval <-> DateTimeDelta casting. [Bug #653044] ! * Corrected problem found by Adam Buraczewski in the __setupTransaction ! function. ! * Allow both 'e' and 'E' to signify an exponet in the PgNumeric constructor. ! * Correct some problems that were missed in yesterday's fixes (Thanks, ! Adam, for the help with the problems) ! Changes to libpqmodule.c ! ------------------------ ! * On win32, we usually statically link against libpq. Because of ! fortunate circumstances, a problem didn't show up until now: we need to ! call WSAStartup() to initialize the socket stuff from Windows *in our ! module* in order for the statically linked libpq to work. I just took ! the relevant DllMain function from the libpq sources and put it here. ! * Modified some comments to reflect reality. ! * Applied patch from Laurent Pinchart: In libPQquoteString, bytea are ! quoted using as much as 5 bytes per input byte (0x00 is quoted '\\000'), ! so allocating (slen * 4) + 3 is not enough for data that contain lots of ! 0x00 bytes. ! * Added PG_TIMETZ to the mix [Patch #708013]. ! ! Changes to pgboolean.c ! ---------------------- ! * Change the name of the quoting function back to _quote. __*__ type ! names should be restricted to system names. + Changes to pgconnection.c + ------------------------- + * Applied patch by Laurent Pinchart to correct a problem lo_import, + lo_export, lo_unlink. + * In case PQgetResult returns NULL, let libPQgetResult return a Python + None, like the docstring says. This is necessary in order to be able + to cancel queries, as after cancelling a query with PQrequestCancel, + we need to read results until PQgetResult returns NULL. + Changes to pglargeobject.c -------------------------- ! * Change the name of the quoting function back to _quote. __*__ type ! names should be restricted to system names. ! Changes to pgnotify.c ! --------------------- ! * Fixed a bug in the code. The code in question use to work, but doesn't ! anymore (possible change to libpq?). Index: ChangeLog =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/ChangeLog,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ChangeLog 6 Dec 2002 05:29:37 -0000 1.19 --- ChangeLog 14 Jul 2003 21:21:10 -0000 1.20 *************** *** 1,4 **** --- 1,91 ---- #ident "$Id$" + Changes since pyPgSQL Version 2.3 + ================================= + + =-=-=-=-=-=-=-=-=-=-=-=-=- ** IMPORTANT NOTE ** =-=-=-=-=-=-=-=-=-=-=-=-=-= + NOTE: There is a change to the Connection.binary() function that *could* + cause existing code to break. Connection.binary() no longer commits + the transaction used to create the large object. The application + developer is now responsible for commiting (or rolling back) the + transaction. + -=-=-=-=-=-=-=-=-=-=-=-=-= ** IMPORTANT NOTE ** -=-=-=-=-=-=-=-=-=-=-=-=-=- + + Changes to README + ----------------- + * Updates for 2.4. + + Changes to PgSQL.py + ------------------- + * Applied patch from Laurent Pinchart to allow _quote to correctly process + objects that are sub-classed from String and Long types. + * Change the name of the quoting function back to _quote. Variables named + like __*__ should be restrict to system names. + * PgTypes is now hashable. repr() of a PgType will now return the repr() + of the underlying OID. + * Connection.binary() will now fail if autocommit is enabled. + * Connection.binary() will no longer commit the transaction after creating + the large object. The application developer is now responsible for + commiting (or for rolling back) the transaction [Bug #747525]. + * Added PG_TIMETZ to the mix [Patch #708013]. + * Pg_Money will now accept a string as a parameter. + * PostgreSQL int2, int, int4 will now be cast into Python ints. Int8 will + be cast into a Python long. Float4, float8, and money types will be + cast into a Python float. + * Correct problem with the PgNumeric.__radd__ method. [Bug #694358] + * Correct problem with conversion of negitive integers (with a given scale + and precision) to PgNumerics. [Bug #694358] + * Work around a problem where the precision and scale of a query result + can be different from the first result in the result set. [Bug #697221] + * Change the code so that the display length in the cursor.description + attribute is always None instead of '-1'. + * Fixed another problem with interval <-> DateTimeDelta casting. + * Corrected a problem that caused the close of a portal (ie. PostgreSQL + cursor) to fail. + * Corrected a problem with interval <-> DateTimeDelta casting. [Bug #653044] + * Corrected problem found by Adam Buraczewski in the __setupTransaction + function. + * Allow both 'e' and 'E' to signify an exponet in the PgNumeric constructor. + * Correct some problems that were missed in yesterday's fixes (Thanks, + Adam, for the help with the problems) + + Changes to libpqmodule.c + ------------------------ + * On win32, we usually statically link against libpq. Because of + fortunate circumstances, a problem didn't show up until now: we need to + call WSAStartup() to initialize the socket stuff from Windows *in our + module* in order for the statically linked libpq to work. I just took + the relevant DllMain function from the libpq sources and put it here. + * Modified some comments to reflect reality. + * Applied patch from Laurent Pinchart: In libPQquoteString, bytea are + quoted using as much as 5 bytes per input byte (0x00 is quoted '\\000'), + so allocating (slen * 4) + 3 is not enough for data that contain lots of + 0x00 bytes. + * Added PG_TIMETZ to the mix [Patch #708013]. + + Changes to pgboolean.c + ---------------------- + * Change the name of the quoting function back to _quote. __*__ type + names should be restricted to system names. + + Changes to pgconnection.c + ------------------------- + * Applied patch by Laurent Pinchart to correct a problem lo_import, + lo_export, lo_unlink. + * In case PQgetResult returns NULL, let libPQgetResult return a Python + None, like the docstring says. This is necessary in order to be able + to cancel queries, as after cancelling a query with PQrequestCancel, + we need to read results until PQgetResult returns NULL. + + Changes to pglargeobject.c + -------------------------- + * Change the name of the quoting function back to _quote. __*__ type + names should be restricted to system names. + + Changes to pgnotify.c + --------------------- + * Fixed a bug in the code. The code in question use to work, but doesn't + anymore (possible change to libpq?). + Changes since pyPgSQL Version 2.2 ================================= *************** *** 34,43 **** * Remove out of date warning about PostgreSQL on win32 * Reflected change from windows/ to ports/ ! Changes to PgSQL.py ------------------- * Fixed various problems with the PgNumeric constructor and formatting routines. ! * Fixed problems with new __setupTransaction function: | 1. Made it a method of Connection, not Cursor. 2. inTransaction was only set if TransactionLevel was set. --- 121,130 ---- * Remove out of date warning about PostgreSQL on win32 * Reflected change from windows/ to ports/ ! Changes to PgSQL.py ------------------- * Fixed various problems with the PgNumeric constructor and formatting routines. ! * Fixed problems with new __setupTransaction function: 1. Made it a method of Connection, not Cursor. 2. inTransaction was only set if TransactionLevel was set. *************** *** 46,50 **** Connection__closeCursor -> _Connection__closeCursor * Cleaned up code where there was unneeded references to conn in Connection ! class. | * Handle the new '__quote__' method for arrays, too. * Still handle '_quote' methods for backwards compatibility. --- 133,137 ---- Connection__closeCursor -> _Connection__closeCursor * Cleaned up code where there was unneeded references to conn in Connection ! class. * Handle the new '__quote__' method for arrays, too. * Still handle '_quote' methods for backwards compatibility. |