aboutsummaryrefslogtreecommitdiff
path: root/src/pl/plpython
Commit message (Collapse)AuthorAge
* Restructure some header files a bit, in particular heapam.h, by removing someAlvaro Herrera2008-05-12
| | | | | | | | | | | | unnecessary #include lines in it. Also, move some tuple routine prototypes and macros to htup.h, which allows removal of heapam.h inclusion from some .c files. For this to work, a new header file access/sysattr.h needed to be created, initially containing attribute numbers of system columns, for pg_dump usage. While at it, make contrib ltree, intarray and hstore header files more consistent with our header style.
* Fix plpython to not get totally confused by OUT arguments. (It still doesn'tTom Lane2008-05-03
| | | | | | support multiple OUT arguments, though.) Hannu Krosing
* Implement a few changes to how shared libraries and dynamically loadablePeter Eisentraut2008-04-07
| | | | | | | | | | | | | | | modules are built. Foremost, it creates a solid distinction between these two types of targets based on what had already been implemented and duplicated in ad hoc ways before. Specifically, - Dynamically loadable modules no longer get a soname. The numbers previously set in the makefiles were dummy numbers anyway, and the presence of a soname upset a few packaging tools, so it is nicer not to have one. - The cumbersome detour taken on installation (build a libfoo.so.0.0.0 and then override the rule to install foo.so instead) is removed. - Lots of duplicated code simplified.
* Support statement-level ON TRUNCATE triggers. Simon RiggsTom Lane2008-03-28
|
* Simplify and standardize conversions between TEXT datums and ordinary CTom Lane2008-03-25
| | | | | | | | | | | | | | | | | | | | strings. This patch introduces four support functions cstring_to_text, cstring_to_text_with_len, text_to_cstring, and text_to_cstring_buffer, and two macros CStringGetTextDatum and TextDatumGetCString. A number of existing macros that provided variants on these themes were removed. Most of the places that need to make such conversions now require just one function or macro call, in place of the multiple notational layers that used to be needed. There are no longer any direct calls of textout or textin, and we got most of the places that were using handmade conversions via memcpy (there may be a few still lurking, though). This commit doesn't make any serious effort to eliminate transient memory leaks caused by detoasting toasted text objects before they reach text_to_cstring. We changed PG_GETARG_TEXT_P to PG_GETARG_TEXT_PP in a few places where it was easy, but much more could be done. Brendan Jurd and Tom Lane
* Fix plpython's overoptimistic caching of information about the rowtype ofTom Lane2008-01-02
| | | | | | | | | | | a trigger's target table. The rowtype could change from one call to the next, so cope in such cases, while avoiding doing repetitive catalog lookups. Per bug #3847 from Mark Reid. Backpatch to 8.2.x. Likely this fix should go further back, but I can't test it because I no longer have a machine with a pre-2.5 Python installation. (Maybe we should rethink that idea about not supporting Python 2.5 in the older branches.)
* Fix buggy usage of vsnprintf in PL/Python by removing it altogether, insteadAlvaro Herrera2007-11-23
| | | | | relying on stringinfo.c. This fixes a problem reported by Marko Kreen, but I didn't use his patch, per subsequent discussion.
* pgindent run for 8.3.Bruce Momjian2007-11-15
|
* Fix uninitialized-memory bug in plpython proargnames patch. Per bug #3523Tom Lane2007-08-10
|
* Volatile-qualify a dozen variables in plpython.c to eliminate warningsTom Lane2007-07-13
| | | | | | from old versions of gcc. It's not clear to me that this is really necessary for correctness, but less warnings are always good. Per buildfarm results and local testing.
* Make some messages more consistentPeter Eisentraut2007-05-31
|
* Remove plpython casts C source code casts:Bruce Momjian2007-04-04
| | | | | | | | | | | | | | It removes last remaining casts inside struct definitions. Such usage is bad practice, as it hides problems from compiler. Reason for the cast is popular practice in some circles to define functions as foo(MyObj *) instead of foo(PyObject *) thus avoiding a local variable inside functions and make direct calling easier. As pl/python does not use such style, the casts were unnecessary from the start. Marko Kreen
* Allow pl/pythonu >= version 2.3 to return boolean, rather than 1/0.Bruce Momjian2007-04-03
| | | | Marko Kreen
* Allow PL/PythonU to compile on Python 2.5. Change needed because of APIBruce Momjian2007-04-03
| | | | | | changes in Python. Marko Kreen
* Support enum data types. Along the way, use macros for the values ofTom Lane2007-04-02
| | | | | pg_type.typtype whereever practical. Tom Dunstan, with some kibitzing from Tom Lane.
* Allow pltcl args to spi_prepare and plpython args to plpy.prepare to be ↵Andrew Dunstan2007-02-21
| | | | standard type aliases as well as those known in pg_type. Similar to recent change in plperl.
* Put back some not-so-unnecessary-as-all-that := usages. Per buildfarm.Tom Lane2007-02-10
|
* Replace useless uses of := by = in makefiles.Peter Eisentraut2007-02-09
|
* Combine cmin and cmax fields of HeapTupleHeaders into a single field, byTom Lane2007-02-09
| | | | | | | | | | keeping private state in each backend that has inserted and deleted the same tuple during its current top-level transaction. This is sufficient since there is no need to be able to determine the cmin/cmax from any other transaction. This gets us back down to 23-byte headers, removing a penalty paid in 8.0 to support subtransactions. Patch by Heikki Linnakangas, with minor revisions by moi, following a design hashed out awhile back on the pghackers list.
* Wording cleanup for error messages. Also change can't -> cannot.Bruce Momjian2007-02-01
| | | | | | | | | | | | | | Standard English uses "may", "can", and "might" in different ways: may - permission, "You may borrow my rake." can - ability, "I can lift that log." might - possibility, "It might rain today." Unfortunately, in conversational English, their use is often mixed, as in, "You may use this variable to do X", when in fact, "can" is a better choice. Similarly, "It may crash" is better stated, "It might crash".
* Fix plpython MSVC build in non-debug mode.Andrew Dunstan2007-01-28
|
* Reverse out use of Py_RETURN_TRUE in plpython, only supported in Python >=Bruce Momjian2007-01-25
| | | | 2.3.
* Fix for plpython functions; return true/false for boolean,Bruce Momjian2007-01-25
| | | | | | | rather than 1/0. This helps when creating trigger functions that output SQL. Guido Goldstein
* Fix plpython to work (or at least pass its regression tests) withTom Lane2006-11-21
| | | | | | python 2.5. This involves fixing several violations of the published spec for creating PyTypeObjects, and adding another regression test expected output for yet another variation of error message spelling.
* Remove use of whrandom module, which was removed in Python 2.5.Peter Eisentraut2006-10-16
|
* pgindent run for 8.2.Bruce Momjian2006-10-04
|
* Define errcode as __msvc_errcode not __vc_errcode for MSVC builds,Tom Lane2006-09-16
| | | | per Magnus.
* Allow PL/python to return composite types and result setsBruce Momjian2006-09-02
| | | | Sven Suursoho
* Add new return codes SPI_OK_INSERT_RETURNING etc to the SPI API.Tom Lane2006-08-27
| | | | | | | Fix all the standard PLs to be able to return tuples from FOO_RETURNING statements as well as utility statements that return tuples. Also, fix oversight that SPI_processed wasn't set for a utility statement returning tuples. Per recent discussion.
* Add a feature for automatic initialization and finalization of dynamicallyTom Lane2006-08-08
| | | | | | | | | loaded libraries: call functions _PG_init() and _PG_fini() if the library defines such symbols. Hence we no longer need to specify an initialization function in preload_libraries: we can assume that the library used the _PG_init() convention, instead. This removes one source of pilot error in use of preloaded libraries. Original patch by Ralf Engelschall, preload_libraries changes by me.
* Ah, I finally realize why Magnus wanted to add a --bindir option toTom Lane2006-07-21
| | | | | | | | | pg_regress: there's no other way to cope with testing a relocated installation. Seems better to call it --psqldir though, since the only thing we need to find in that case is psql. It'd be better if we could use find_other_exec, but that's not happening unless we are willing to install pg_regress alongside psql, which seems unlikely to happen.
* Rewrite pg_regress as a C program instead of a shell script.Tom Lane2006-07-19
| | | | | | | This allows it to be used on Windows without installing mingw (though you do still need 'diff'), and opens the door to future improvements such as message localization. Magnus Hagander and Tom Lane.
* Attached patch is required ot build with the CRT that comes with VisualBruce Momjian2006-07-06
| | | | | | | | | | Studio 2005. Basically MS defined errcode in the headers with a typedef, so we have to #define it out of the way. While at it, fix a function declaration in plpython that didn't match the implementation (volatile missing). Magnus Hagander
* Fix Win32/Cygwin problems:Bruce Momjian2006-06-25
| | | | | | | | | | | | | | After updating to the latest cvs, and also building most of the addons (like PLs), the following patch is neededf for win32 + Visual C++. * Switch to use the new win32 semaphore code * Rename win32_open to pgwin32_open. win32_open collides with symbols defined in Perl. MingW didn't detect ig, MSVC did. And it's a bit too generic a name to export globally, imho... * Python defines some partially broken #pragmas in the headers when doing a debug build. Workaround. Magnus Hagander
* Fix problems with cached tuple descriptors disappearing while still in useTom Lane2006-06-16
| | | | | | | | | | by creating a reference-count mechanism, similar to what we did a long time ago for catcache entries. The back branches have an ugly solution involving lots of extra copies, but this way is more efficient. Reference counting is only applied to tupdescs that are actually in caches --- there seems no need to use it for tupdescs that are generated in the executor, since they'll go away during plan shutdown by virtue of being in the per-query memory context. Neil Conway and Tom Lane
* Magic blocks don't do us any good unless we use 'em ... so install oneTom Lane2006-05-30
| | | | in every shared library.
* Looks like the new plpython regression test fails on older pythons. See if ↵Andrew Dunstan2006-05-27
| | | | this works.
* Add table_name and table_schema to plpython trigger data, plus docs and ↵Andrew Dunstan2006-05-26
| | | | regression test.
* Revert patch, causing plpython regression failues:Bruce Momjian2006-04-27
| | | | | | > >> >> > 1) named parameters additionally to args[] > >> >> > 2) return composite-types from plpython as dictionary > >> >> > 3) return result-set from plpython as list, iterator or generator
* plpython improvements:Bruce Momjian2006-04-27
| | | | | | | | | 1) named parameters additionally to args[] 2) return composite-types from plpython as dictionary 3) return result-set from plpython as list, iterator or generator Hannu Krosing Sven Suursoho
* Modify all callers of datatype input and receive functions so that if theseTom Lane2006-04-04
| | | | | | | | | | | | | | | functions are not strict, they will be called (passing a NULL first parameter) during any attempt to input a NULL value of their datatype. Currently, all our input functions are strict and so this commit does not change any behavior. However, this will make it possible to build domain input functions that centralize checking of domain constraints, thereby closing numerous holes in our domain support, as per previous discussion. While at it, I took the opportunity to introduce convenience functions InputFunctionCall, OutputFunctionCall, etc to use in code that calls I/O functions. This eliminates a lot of grotty-looking casts, but the main motivation is to make it easier to grep for these places if we ever need to touch them again.
* Improve parser so that we can show an error cursor position for errorsTom Lane2006-03-14
| | | | | | | | | | | during parse analysis, not only errors detected in the flex/bison stages. This is per my earlier proposal. This commit includes all the basic infrastructure, but locations are only tracked and reported for errors involving column references, function calls, and operators. More could be done later but this seems like a good set to start with. I've also moved the ReportSyntaxErrorPosition logic out of psql and into libpq, which should make it available to more people --- even within psql this is an improvement because warnings weren't handled by ReportSyntaxErrorPosition.
* Remove copyright notices from Jan (per author approval), and those filesBruce Momjian2006-03-11
| | | | derived from Jan's.
* Adjust plpython for escape_string_warning.Bruce Momjian2006-03-08
|
* Adjust PL regression tests for escape_string_warning.Bruce Momjian2006-03-08
|
* Update the expected regression test results to account for the changes toNeil Conway2006-03-01
| | | | | error messages I made yesterday -- thanks to Andrew Dunstan for reporting this, and my apologies for missing it the first time.
* This patch makes the error message strings throughout the backendNeil Conway2006-03-01
| | | | | | | | more compliant with the error message style guide. In particular, errdetail should begin with a capital letter and end with a period, whereas errmsg should not. I also fixed a few related issues in passing, such as fixing the repeated misspelling of "lexeme" in contrib/tsearch2 (per Tom's suggestion).
* Tweak the error message emitted when a void-returning PL/Python functionNeil Conway2006-02-28
| | | | does not return None, per suggestion from Tom.
* Allow PL/Python functions to return void, per gripe from James RobinsonNeil Conway2006-02-28
| | | | | | | (I didn't use his patch, however). A void-returning PL/Python function must return None (from Python), which is translated into a void datum (and *not* NULL) for Postgres. I also added some regression tests for this functionality.
* Fix three Python reference leaks in PLy_traceback(). This would resultNeil Conway2006-02-20
| | | | | | | | | | in leaking memory when invoking a PL/Python procedure that raises an exception. Unfortunately this still leaks memory, but at least the largest leak has been plugged. This patch also fixes a reference counting mistake in PLy_modify_tuple() for 8.0, 8.1 and HEAD: we don't actually own a reference to `platt', so we shouldn't Py_DECREF() it.