summaryrefslogtreecommitdiff
path: root/src/interfaces/python
AgeCommit message (Collapse)Author
2002-12-11Bump version for 7.3 and 7.4.Bruce Momjian
2002-12-10Add an unnecessary assignment to remove a bogus warning. I checked theD'Arcy J.M. Cain
logic carefully and I am sure that the test against n happens after it is assigned to.
2002-12-06PyGreSQL inserttable patchBruce Momjian
===================== I suggested an improvement of the inserttable in the PyGreSQL interface already in January, but seemingly it was never implemented. I was told this is the right place to get patches in for PyGreSQL, so I'm reposting my patch here. I consider the inserttable methode essential in populating the database because of its benefits in performance compared to insert, so I think this patch is quite essential. The attachment is an improved version of the corresponding pg_inserttable function in pgmodule.c, which fixes the following problems: * The function raised exceptions because PyList_GetItem was used beyond the size of the list. This was checked by comparing the result with NULL, but the exception was not cleaned up, which could result in mysterious errors in the following Python code. Instead of clearing the exception using PyErr_Clear or something like that, I avoided throwing the exception at all by at first requesting the size of the list. Using this opportunity, I also checked the uniformity of the size of the rows passed in the lists/tuples. The function also accepts (and silently ignores) empty lists and sublists. * Python "None" values are now accepted and properly converted to PostgreSQL NULL values * The function now generates an error message in case of a line buffer overflow * It copes with tabulators, newlines and backslashes in strings now * Rewrote the buffer filling code which should now run faster by avoiding unnecessary string copy operations forth and back Christoph Zwerschke
2002-12-04Stamp minor version numbers for 7.4 release.Bruce Momjian
2002-12-04Remove typprtlen from getdescr() as it is not available in 7.3. Return -1 forD'Arcy J.M. Cain
that field so that existing programs don't break.
2002-11-25I'm sending you a small patch to pgdb.py module. ThisD'Arcy J.M. Cain
raises pgdb.DatabaseError when any of the fetch* methods was invoked but previous call to execute* did not produce any result set or no call was issued yet. Also, raises pgdb.NotSupportedError when .nextset() is invoked, instead of NameError. This behaviour complies with DB-API 2.0. Thanks for your work! Timur Irmatov.
2002-11-25Change the pkey method so that the caller can optionally set the dictionaryD'Arcy J.M. Cain
used for the primary key lookup. This will prevent a database lookup for each connection object that gets created. This could be a significant optimization on a busy system. Similarly, the get_attnames method allows for the attributes dictionary to be installed directly.
2002-11-25Change the debug variable to allow better control by the caller over howD'Arcy J.M. Cain
debug output is managed. The user can continue to use the current method of passing a formatting string to have a replacement done and output will be sent to the standard output exactly as it did before. In addition they can set it to a file object, sys.stderr for example, and the query string will be printed to it. Thay can also set it to a method (function) and the query string will be passed to that method giving them the maximum flexibility to do whatever they want with the query string. I will be working with the PyGreSQL documentation shortly and at that time will properly document this feature.
2002-11-23This patch implements FOR EACH STATEMENT triggers, per my email toBruce Momjian
-hackers a couple days ago. Notes/caveats: - added regression tests for the new functionality, all regression tests pass on my machine - added pg_dump support - updated PL/PgSQL to support per-statement triggers; didn't look at the other procedural languages. - there's (even) more code duplication in trigger.c than there was previously. Any suggestions on how to refactor the ExecXXXTriggers() functions to reuse more code would be welcome -- I took a brief look at it, but couldn't see an easy way to do it (there are several subtly-different versions of the code in question) - updated the documentation. I also took the liberty of removing a big chunk of duplicated syntax documentation in the Programmer's Guide on triggers, and moving that information to the CREATE TRIGGER reference page. - I also included some spelling fixes and similar small cleanups I noticed while making the changes. If you'd like me to split those into a separate patch, let me know. Neil Conway
2002-09-23Move PyGreSQL usage documentation from README into DocBook. Some otherPeter Eisentraut
editing.
2002-09-04pgindent run.Bruce Momjian
2002-08-28This is a quick patch to fix a crash in pgquery_dictresult() introducedBruce Momjian
recently. I just ran into it while running a set of python test scripts, and I'm not sure who the normal maintainer is for interfaces/python. John Nield
2002-08-15This fixes some text as well as enforces the use of "drop table cascade"Bruce Momjian
since we moved from an implicate to explicate implementation. Greg Copeland
2002-08-15Well, that certainly appeared to be very straight forward. pg.py andBruce Momjian
syscat.py scripts were both modified. pg.py uses it to cache a list of pks (which is seemingly does for every db connection) and various attributes. syscat uses it to walk the list of system tables and queries the various attributes from these tables. In both cases, it seemingly makes sense to apply what you've requested. Greg Copeland
2002-08-15http://archives.postgresql.org/pgsql-bugs/2002-06/msg00086.php and neverBruce Momjian
saw a fix offered up. Since I'm gearing up to use Postgres and Python soon, I figured I'd have a hand at trying to get this sucker addressed. Apologies if this has already been plugged. I looked in the archives and never saw a response. At any rate, I must admit I don't think I fully understand the implications of some of the changes I made even though they appear to be straight forward. We all know the devil is in the details. Anyone more knowledgeable is requested to review my changes. :( I also updated the advanced.py script in a somewhat nonsensical fashion to make use of an int8 field in an effort to test this change. It seems to run okay, however, this is by no means an all exhaustive test. So, it's possible that a bumpy road may lay ahead for some. On the other hand...overflows (hopefully) previously lurked (long -> int conversion). Greg Copeland
2002-06-03Small patch to correct the default arraysize associatedBruce Momjian
with the Cursor object's fetchmany() method. The API and inline documentation state that the default is 1. It currently defaults to 5. Patrick Macdonald
2002-05-03Fix typo in usage instructions.Tom Lane
2002-05-03Remove the last traces of datatypes datetime and timespan.Tom Lane
2002-04-24pgdb.connect() seems to be broken on Python 2.0.1 (which ships withBruce Momjian
Slackware 8), and perhaps on other Pythons, haven't checked. Something in the _pg.connect() call isn't working. I think the problem stems from the fact that 'host' is a named parameter of both _pg.connect and pgdb.connect, and so Python treats it as a variable assignment, not a named parameter. Uses non-named parameters. Andrew Johnson
2002-04-18Back out python change, needs delay.Bruce Momjian
2002-04-18Change docs to do 20! rather than larger.Bruce Momjian
2002-04-11Restructure representation of aggregate functions so that they have pg_procTom Lane
entries, per pghackers discussion. This fixes aggregates to live in namespaces, and also simplifies/speeds up lookup in parse_func.c. Also, add a 'proimplicit' flag to pg_proc that controls whether a type coercion function may be invoked implicitly, or only explicitly. The current settings of these flags are more permissive than I would like, but we will need to debate and refine the behavior; for now, I avoided breaking regression tests as much as I could.
2002-03-29Fox for old python PyMem_DEL, was PyMem_Del,Bruce Momjian
2002-03-29Fix '#' commant to be proper C comment.Bruce Momjian
2002-03-26Further changes following discussion on INTERFACES mailing list:D'Arcy J.M. Cain
- Use PyObject_Del() rather than macro version - Check version and drop back to PyMem_Del() for older systems.
2002-03-20PyGreSQL causes a segfault when used with a Python executable that wasD'Arcy J.M. Cain
compiled with --with-pymalloc. This change fixes that. Thanks to Dave Wallace <dwallace@udel.edu>
2002-03-19Bump version number to match tree.D'Arcy J.M. Cain
2002-03-19Fix name in comments and add info about this module's place in PyGreSQL.D'Arcy J.M. Cain
2002-03-19> I am backing out this patch. Please resubmit with this corrected. Thanks.Bruce Momjian
> > I am running Python 1.5. Therein lies the problem... :) Since it appears you have the requirement of supporting old python versions, attached is just the pgdb.py part of the patch (with a fix for DateTime handling). It has the same functionality but certainly won't be quite as fast. Given the absence of _PyString_Join in python1.5, it's a pain to get the C variants working for all versions. The pgdb.py patch does leaves the hooks in, should someone wish to do the optimization at a later point. Elliot Lee
2002-03-05Back out python patch:Bruce Momjian
Elliot Lee wrote: > This patch to the python bindings adds C versions of the often-used query > args quoting routines, as well as support for quoting lists e.g. > dbc.execute("SELECT * FROM foo WHERE blah IN %s", ([1,2,3],))
2002-03-05This patch to the python bindings adds C versions of the often-usedBruce Momjian
query args quoting routines, as well as support for quoting lists e.g. dbc.execute("SELECT * FROM foo WHERE blah IN %s", ([1,2,3],)) Elliot Lee
2001-12-13revert last changePeter Eisentraut
2001-12-03Bump version to 3.3. Mostly this is because there is some confusion aboutD'Arcy J.M. Cain
the latest version and I wanted to make sure that there was a clean release. I also change the build files as I discussed in my letter of Nov 6, 2001. At the time I was asked to hold off until after the release.
2001-11-19A bunch of small doco updates motivated by scanning the comments onTom Lane
the interactive docs.
2001-11-05New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian
initdb/regression tests pass.
2001-11-04Version was 3.3 but last released version was 3.1. Setting to match restD'Arcy J.M. Cain
of the documentation in preparation for upcoming release.
2001-11-04Note that PyGreSQL has been checked against Python 2.1 now.D'Arcy J.M. Cain
2001-11-04The "%d", while syntactically correct, was confusing. Added a space toD'Arcy J.M. Cain
make it clearer that d was the argument to the format operator.
2001-10-28Another pgindent run. Fixes enum indenting, and improves #endifBruce Momjian
spacing. Also adds space for one-line comments.
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-10-19> This stops the interface from leaking the row tuples (and thus theBruce Momjian
> results of every fetch). Stephen Robert Norris
2001-10-16Python handle as string all int8 values from postgresql. This could beBruce Momjian
view when using the aggregate function count() and function nextval that returns an int8 value, but in python is represented like string: >> db.query("select nextval('my_seq')").getresult() [('2',)] >> db.query("select count(*) from films").dictresult() [{'count': '120'}] Ricardo Caesar Lenzi
2001-09-19Change the version. We are moving towards the next release.D'Arcy J.M. Cain
Fixed a nasty bug that messed up negative money amounts.
2001-09-10Remove INV_ARCHIVE mention in python readme.Bruce Momjian
2001-08-24Rename config.h to pg_config.h and os.h to pg_config_os.h, fix a number ofPeter Eisentraut
places that were including the wrong files.
2001-08-16This patch fixes the well-known but unfixed bug that fetchone() always returnsBruce Momjian
the first result in the DB-API compliant wrapper. It turned out that the bug was way down in the C code. Gerhard Häring
2001-07-11Add prototypes to supress warnings.Bruce Momjian
2001-07-10Support fake root install, separate build dir, dependency tracking, ourPeter Eisentraut
choice of compiler and flags, uninstall, and peculiar Python installation layouts for PyGreSql. Also install into site-packages now, as officially recommended. And pgdb.py is also installed now, used to be forgotten.
2001-06-22Include catalog/pg_type.h instead of manually extracting the interestingPeter Eisentraut
oid values.
2001-06-20Make sure that everything says version 3.2.D'Arcy J.M. Cain