summaryrefslogtreecommitdiff
path: root/src/pl/plpython/plpython.c
AgeCommit message (Collapse)Author
2005-03-24Adjust plpython to convert \r\n and \r to \n in Python scripts,Tom Lane
per recent discussion concluding that this is the Right Thing. Add regression test check for this behavior. Michael Fuhr
2004-12-17Hook up the plpython result-object nrows and status methods correctly.Tom Lane
Adjust documentation to match current reality.
2004-09-19Add defenses against plpython functions being declared to take or returnTom Lane
pseudotypes. Not sure why I neglected to add these checks at the same time I added them to the other PLs, but it seems I did.
2004-09-13Redesign query-snapshot timing so that volatile functions in READ COMMITTEDTom Lane
mode see a fresh snapshot for each command in the function, rather than using the latest interactive command's snapshot. Also, suppress fresh snapshots as well as CommandCounterIncrement inside STABLE and IMMUTABLE functions, instead using the snapshot taken for the most closely nested regular query. (This behavior is only sane for read-only functions, so the patch also enforces that such functions contain only SELECT commands.) As per my proposal of 6-Sep-2004; I note that I floated essentially the same proposal on 19-Jun-2002, but that discussion tailed off without any action. Since 8.0 seems like the right place to be taking possibly nontrivial backwards compatibility hits, let's get it done now.
2004-08-30Another pgindent run with lib typedefs added.Bruce Momjian
2004-08-29Pgindent run for 8.0.Bruce Momjian
2004-08-05Move include for Python.h above postgres.h to eliminate compiler warning.Joe Conway
2004-08-04Label CVS tip as 8.0devel instead of 7.5devel. Adjust various commentsTom Lane
and documentation to reference 8.0 instead of 7.5.
2004-07-31Be more consistent about reporting SPI errors in the various PLs.Tom Lane
Create a shared function to convert a SPI error code into a string (replacing near-duplicate code in several PLs), and use it anywhere that a SPI function call error is reported.
2004-07-31Restructure error handling as recently discussed. It is now reallyTom Lane
possible to trap an error inside a function rather than letting it propagate out to PostgresMain. You still have to use AbortCurrentTransaction to clean up, but at least the error handling itself will cooperate.
2004-06-06Infrastructure for I/O of composite types: arrange for the I/O routinesTom Lane
of a composite type to get that type's OID as their second parameter, in place of typelem which is useless. The actual changes are mostly centralized in getTypeInputInfo and siblings, but I had to fix a few places that were fetching pg_type.typelem for themselves instead of using the lsyscache.c routines. Also, I renamed all the related variables from 'typelem' to 'typioparam' to discourage people from assuming that they necessarily contain array element types.
2004-06-05Tweak palloc/repalloc to allow zero bytes to be requested, as per recentTom Lane
proposal. Eliminate several dozen now-unnecessary hacks to avoid palloc(0). (It's likely there are more that I didn't find.)
2004-05-07Solve the 'Turkish problem' with undesirable locale behavior for caseTom Lane
conversion of basic ASCII letters. Remove all uses of strcasecmp and strncasecmp in favor of new functions pg_strcasecmp and pg_strncasecmp; remove most but not all direct uses of toupper and tolower in favor of pg_toupper and pg_tolower. These functions use the same notions of case folding already developed for identifier case conversion. I left the straight locale-based folding in place for situations where we are just manipulating user data and not trying to match it to built-in strings --- for example, the SQL upper() function is still locale dependent. Perhaps this will prove not to be what's wanted, but at the moment we can initdb and pass regression tests in Turkish locale.
2004-04-01Replace TupleTableSlot convention for whole-row variables and functionTom Lane
results with tuples as ordinary varlena Datums. This commit does not in itself do much for us, except eliminate the horrid memory leak associated with evaluation of whole-row variables. However, it lays the groundwork for allowing composite types as table columns, and perhaps some other useful features as well. Per my proposal of a few days ago.
2004-01-07More janitorial work: remove the explicit casting of NULL literals to aNeil Conway
pointer type when it is not necessary to do so. For future reference, casting NULL to a pointer type is only necessary when (a) invoking a function AND either (b) the function has no prototype OR (c) the function is a varargs function.
2004-01-06Apply the core parts of Dennis Bjorklund's patch to allow functionTom Lane
parameters to be declared with names. pg_proc has a column to store names, and CREATE FUNCTION can insert data into it, but that's all as yet. I need to do more work on the pg_dump and plpgsql portions of the patch before committing those, but I thought I'd get the bulky changes in before the tree drifts under me. initdb forced due to pg_proc change.
2004-01-04Remove trailing semicolons from macro initializations in plpython.Bruce Momjian
Problem report on True64 Unix by Nikola Milutinovic.
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-09-16Fix some problems with dropped columns in plpython trigger functions.Tom Lane
2003-09-14Fix plpython to generate separate cached procedure data for eachTom Lane
relation, when the same function is used as a trigger on more than one relation. This avoids crashes due to differing rowtypes for different relations. Per bug report from Lance Thomas, 7-Feb-03.
2003-08-04Fix pltcl and plpython to support STATEMENT triggers.Tom Lane
Joe Conway
2003-08-04Put back braces removed by pgindent (not really pgindent's fault).Tom Lane
2003-08-04pgindent run.Bruce Momjian
2003-07-31Cause library-preload feature to report error if specified initializationTom Lane
function is not found. Also, make all the PL libraries have initialization functions with standard names. Patch from Joe Conway.
2003-07-25Error message editing in src/pl. The plpython module could use anotherTom Lane
look ... I'm not real certain which errors are strictly internal and which are likely to be provoked by users.
2003-06-25> I've worked with the Pl/Python code in the past and will see about removingBruce Momjian
> rexec and making it an untrusted language. Last time I looked, it didn't > look particularly difficult. I've set aside some time next week, so stay > tuned. Attached is a patch that removes all of the RExec code from plpython from the current PostgreSQL CVS. In addition, plpython needs to be changed to an untrusted language in createlang. Please let me know if there are any problems. Kevin Jacobs
2003-06-11Fix brain damage in deciding which python input converter to use.Tom Lane
2003-05-27Make debug_ GUC varables output DEBUG1 rather than LOG, and mention inBruce Momjian
docs that CLIENT/LOG_MIN_MESSAGES now controls debug_* output location. Doc changes included.
2003-03-10This patch fixes a bunch of spelling mistakes in comments throughout theTom Lane
PostgreSQL source code. Neil Conway
2003-02-13Repair incorrect indexing for atttypmod, per Brad McLean.Tom Lane
2003-01-31Make plpython's spi_execute interface handle NULLs properly.Tom Lane
From Andrew Bosma.
2003-01-31Clean up plpython error reporting so that its regression test passesTom Lane
with some amount of cleanliness. I see no need to report the internal Python name rather than the SQL procedure name in error tracebacks.
2002-11-22Fix a dozen or so places that were passing unpredictable data stringsTom Lane
as elog format strings. Hai-Chen Tu pointed out the problem in contrib/dbmirror, but it wasn't the only such error.
2002-10-19Fix within-function memory leaks in the various PLs' interfaces toTom Lane
SPI_prepare: they all save the prepared plan into topCxt, and so the procCxt copy that's actually returned by SPI_prepare ought to be freed. Diagnosis and plpython fix by Nigel Andrews, followup for other PLs by Tom Lane.
2002-10-14I have attached two patches as per:Bruce Momjian
1) pltcl: Add SPI_freetuptable() calls to avoid memory leaks (Me + Neil Conway) Change sprintf()s to snprintf()s (Neil Conway) Remove header files included elsewhere (Neil Conway) 2)plpython: Add SPI_freetuptable() calls to avoid memory leaks Cosemtic change to remove a compiler warning Notes: I have tested pltcl.c for a) the original leak problem reported for the repeated call of spi_exec in a TCL fragment and b) the subsequent report resulting from the use of spi_exec -array in a TCL fragment. The plpython.c patch is exactly the same as that applied to make revision 1.23, the plpython_schema.sql and feature.expected sections of the patch are also the same as last submited, applied and subsequently reversed out. It remains untested by me (other than via make check). However, this should be safe provided PyString_FromString() _copies_ the given string to make a PyObject. Nigel J. Andrews
2002-09-26Back out /pl memory leak patch. Wait for new version.Bruce Momjian
2002-09-26I have attached the pltcl patch again, just in case. For the sake of clarityBruce Momjian
let's say this patch superscedes the previous one. I have also attached a patch addressing the similar memory leak problem in plpython. This includes a slight adjustment of the tests in the source directory. The patch also includes a cosmetic change to remove a compiler warning although I think the change makes the code look worse though. BTW, by my reckoning the memory leak would occur with prepared plans and without. If that is not the case then I've been barking up the wrong tree. Nigel J. Andrews
2002-09-04Fix compile warning.Peter Eisentraut
2002-09-04pgindent run.Bruce Momjian
2002-08-22Add a bunch of pseudo-types to replace the behavior formerly associatedTom Lane
with OPAQUE, as per recent pghackers discussion. I still want to do some more work on the 'cstring' pseudo-type, but I'm going to commit the bulk of the changes now before the tree starts shifting under me ...
2002-07-20oid is needed, it is added at the end of the struct (after the nullBruce Momjian
bitmap, if present). Per Tom Lane's suggestion the information whether a tuple has an oid or not is carried in the tuple descriptor. For debugging reasons tdhasoid is of type char, not bool. There are predefined values for WITHOID, WITHOUTOID and UNDEFOID. This patch has been generated against a cvs snapshot from last week and I don't expect it to apply cleanly to current sources. While I post it here for public review, I'm working on a new version against a current snapshot. (There's been heavy activity recently; hope to catch up some day ...) This is a long patch; if it is too hard to swallow, I can provide it in smaller pieces: Part 1: Accessor macros Part 2: tdhasoid in TupDesc Part 3: Regression test Part 4: Parameter withoid to heap_addheader Part 5: Eliminate t_oid from HeapTupleHeader Part 2 is the most hairy part because of changes in the executor and even in the parser; the other parts are straightforward. Up to part 4 the patched postmaster stays binary compatible to databases created with an unpatched version. Part 5 is small (100 lines) and finally breaks compatibility. Manfred Koizar
2002-06-15This patch wraps all accesses to t_xmin, t_cmin, t_xmax, and t_cmax inBruce Momjian
HeapTupleHeaderData in setter and getter macros called HeapTupleHeaderGetXmin, HeapTupleHeaderSetXmin etc. It also introduces a "virtual" field xvac by defining HeapTupleHeaderGetXvac and HeapTupleHeaderSetXvac. Xvac is used by VACUUM, in fact it is stored in t_cmin. Manfred Koizar
2002-03-29pg_type has a typnamespace column; system now supports creating typesTom Lane
in different namespaces. Also, cleanup work on relation namespace support: drop, alter, rename commands work for tables in non-default namespaces.
2002-03-06Add new elog() levels to stored procedure languages. plperl DEBUG hackBruce Momjian
still needed because only removed in 7.4.
2002-03-06Change made to elog:Bruce Momjian
o Change all current CVS messages of NOTICE to WARNING. We were going to do this just before 7.3 beta but it has to be done now, as you will see below. o Change current INFO messages that should be controlled by client_min_messages to NOTICE. o Force remaining INFO messages, like from EXPLAIN, VACUUM VERBOSE, etc. to always go to the client. o Remove INFO from the client_min_messages options and add NOTICE. Seems we do need three non-ERROR elog levels to handle the various behaviors we need for these messages. Regression passed.
2002-03-02Commit to match discussed elog() changes. Only update is that LOG isBruce Momjian
now just below FATAL in server_min_messages. Added more text to highlight ordering difference between it and client_min_messages. --------------------------------------------------------------------------- REALLYFATAL => PANIC STOP => PANIC New INFO level the prints to client by default New LOG level the prints to server log by default Cause VACUUM information to print only to the client NOTICE => INFO where purely information messages are sent DEBUG => LOG for purely server status messages DEBUG removed, kept as backward compatible DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1 added DebugLvl removed in favor of new DEBUG[1-5] symbols New server_min_messages GUC parameter with values: DEBUG[5-1], INFO, NOTICE, ERROR, LOG, FATAL, PANIC New client_min_messages GUC parameter with values: DEBUG[5-1], LOG, INFO, NOTICE, ERROR, FATAL, PANIC Server startup now logged with LOG instead of DEBUG Remove debug_level GUC parameter elog() numbers now start at 10 Add test to print error message if older elog() values are passed to elog() Bootstrap mode now has a -d that requires an argument, like postmaster
2001-11-16plpython security and error handling fixes, fromTom Lane
Kevin Jacobs and Brad McLean.
2001-11-05New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian
initdb/regression tests pass.
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.