- Fix failure under recursive SPI calls - Fix crashbug where error message used dangling pointer
reduces unnecessary memory context switching/thrashing - Special case array marshalling, in and out, for int4 and float8 arrays if the following conditions are met: * int4 or float8, pg->R * INTSXP -> int4, R->pg * REALSXP -> float8 R->pg * typbyval (for float8 is true if pg>=8.4 and arch=x86_64 and others?) * No NULL elements, pg->R * No NAs, R->pg * One dimensional array (pg) or vector (R) * At least one element This results in dramtic performance improvement when, for example, passing very large float8 arrays on a 64 bit machine from pg to R.
- Remove obsolete info from README and point to web site instead - Consolidate and reorder all header files in order to avoid namespace conflicts between postgres/R/Win32 - Rather than referencing pkglib_path and Dynamic_library_path, reference my_exec_path instead. This is because the former are not exported in win32 and the latter is. Instead get Dynamic_library_path by calling GetConfigOptionByName() and pkglib_path by calling get_pkglib_path(). - Recognize hex input since bytea output is formatted that way by default starting with PostgreSQL 9.0 - Avoid dynamic assignments with array constructors since MSVC cannot handle them. - Workaround fact that "char **environ" is not available on win32 for plr_environ()
- Makefile fix for Mac OSX per kostas savvidis - Added RPostgreSQL compatability functions - Added ability to send serialized R objects to Postgres as bytea return values - Added ability to convert bytea arguments from Postgres back into the original R object - Added function to unserialize bytea value in order to restore object outside of R (useful for image data)
- Eliminate warnings that started with R-2.6.0 related to lack of const declarations - Add --no-restore to startup options - Fix old bug related to Rversion.h appearing after user of R_VERSION in precompiler tests. Led to Rembedded.h not getting included - Added explicit define for KillAllDevices as it has been removed from Rdevices.h as of R-2.7.0
- New (undocumented) functions r_version(), plr_set_rhome(), and plr_unset_rhome(). - Use Rembedded.h if available - If R_HOME environment variable is not defined, attempt to find it using pkg-config. (idea from Dirk Eddelbuettel) - In any case, create define for default R_HOME based on pkg-config. Use the default R_HOME during R interpreter init if the environment variable is unset. (idea from Dirk Eddelbuettel) - Use PGDLLIMPORT instead of DLLIMPORT is it is defined. - Switch to Rf_isVectorList instead of IS_LIST for spi_execp argument test. Prior to R-2.4.0, the latter allows bad arguments to get past, causing a segfault in an R internal type coersion function. (found by Steve Singer) - New spi cursor manupulation functions (patch courtesy of Steve Singer). - Force R interpreter non-interactive mode. Fixes some cases that previously appeared to be hung postgres backends in certain errors occured in R (R was actually waiting for user input). On some platforms this situation caused segfaults instead. (found by Jie Zhang) - When a plr function source is empty, plr tries to find a function by the same name within the R interpreter environment. If the function could not be found, it would cause a hang or segfault. This was not easily trapped in the R interpreter. Now, build and compile the equivalent plr source. This allows the R interpreter to trap the error properly when the function does not exist. - PG_VERSION_NUM if available. (patch courtesy of Neal Conway) - Plug memory leak in POP_PLERRCONTEXT. (patch courtesy of Steve Singer)
- add pkglib_path declaration for Win32 - modify debug code for PROTECT/UNPROTECT - add missing UNPROTECT(1) in spi code -- fix for "stack imbalance" warning
- added support for NULL array elements (in and out) - plugged security hole courtesy of Jeff Greco <email@example.com>
cooked_path. - Add missing include for "utils/memutils.h". Absence before 8.1 was masked by it being included somewhere else in the hierarchy. - Adjust regression expected files for R-2.1.x. A previously rejected case is now handled without error. Easiest way to deal with this is to just remove the test entirely.
mention pgxs build.
…e on 32 bit Intel systems, but causes compiler warnings and segfaults on 64 bit systems. Add regression test case for data.frame with a factor column that is not a simple non-repeating sequence.
- Allow returning tuples with array columns. Needs cleaning up, but works OK for now. - Fix resource leak -- one PROTECT() was missing its compliment UNPROTECT in pg_conversion. - Adjust for Postgres 8.0.0's PG_TRY()/PG_CATCH() in place of sigsetjmp(Warn_restart, 1), etc, in earlier versions.
- Updated copyright for year 2004 - Transform '_' to '.' in data.frame column names derived from Postgres tuples for R < 1.9.0 - Add support for explicit argument names - Adjust to pg7.5 tuple/slot changes Documentation changes: - Update sgml to DocBook V4.2 - Add tip regarding /etc/ld.so.conf & ldconfig - Mention explicit argument support - Correct instances of "returns record" to "returns setof record" - Add mention of load_r_typenames() which was missing
… return early, restore Warn_restart before returning.
elog/ereports beneath plr's control while executing code called from the R interpreter are wrapped in "if (sigsetjmp(Warn_restart...". This grabs back control before it is returned to the postmaster, and allows us to call R's "error()" function. Now we can allow the R interpreter to gracefully clean up and exit with an error flagged. On the other side of the R eval call, we grab the error flag, and generate another error. This fixes issue raised by Mike Mascari.
…t al in Postgres 7.4 devel. Reworked all elog calls to conform with new standards in 7.4 devel and converted to ereport where appropriate.
Fixed problem with plr_SPI_context global not handling reentrancy correctly, leading to crash when throw_pg_notice was called from a nested plr function. throw_pg_error was directly long jumping out of the R interpreter using elog ERROR. Recently discovered that this leaves R in a precarious state. Modified to simply call "stop(arg)", which now sets up the error message and lets the elog call after R is exited handle our dirty work for us.
R interpreter. Added global string "last_R_error_msg" to hold the result of geterrmessage(). An error in R now calls throw_r_error() with the result of geterrmessage() as its argument. throw_r_error() saves argument in last_R_error_msg. When the R call ends, PL/R will elog using last_R_error_msg whenever it is set, or a generic message when it is not. This works the same for both 7.3 and 7.4.
…nterim commit to save work, but probably need to replace direct elog from within R with some sort of global variable to stuff the error message in, then elog when error was detected after we emerge from the R try_eval call. Remove the preloaded TYPEOIDS and provide instead a new function, load_r_typenames(), that provides the same global variables in the R interpreter. But instead of making *every* connection pay the price, now it can be used on demand only when needed.
…wo rounds changes. Remove dims and dimnames attribute from data.frames created by pg_tuple_get_r_frame(). This fixes a problem that lm() was having with plr created data.frames, and appears to be correct based on the docs and data.frames created by R itself (examined using dput()). Not sure why I ever thought they were needed, but the regression tests still pass.
argument types. This should make polymorphic functions more performant. Design was taken from plpgsql changes recently submitted, as modified by Tom Lane. First pass attempt at error handling nesting, ala plpgsql. Does not seem to work. Next attempt will mimick pltcl.
…execp Finished first pass documentation!!!!
…code -- seem to produce strange results. Provide preloaded function pg.spi.factor as convenience function for converting non-numeric columns of spi produced data.frames into factors. Uses R code to do the conversion to ensure consistancy with native implementation. Attach dimensions and dimnames to data.frames to allow R functions that expect such things to work (e.g. is.na() and as.matrix()). Ensure tuplestore still gets created even for NULL/Nil results -- otherwise Postgres backend complains. Fix get_frame_tuplestore to deal properly with factor columns. Rename throw_pg_error to throw_pg_notice (since that's what it really did). Create real throw_pg_error function in case someone wants to really throw an error from R, but use throw_pg_notice when trapping R errors (similar behavior as before) Continued hacking on documentation.
eliminated use of free, and malloc in favor of pfree and palloc added use of non-exported R function, R_PreserveObject, to pin compiled function in memory and prevent garbage collection from grabbing from under me. Now cached compiled functions no longer mysteriously disappear!
Changed License to BSD in hopes that it will work out that way. Split up pg_get_r into seperate pg_scalar_get_r, pg_array_get_r, and pg_tuple_get_r_frame functions. Improved abstraction and reuse of conversion functions. Fixed bug in get_tuplestore when fcinfo->resultinfo was not set (i.e. when function run in targetlist instead of as a table function). Added special case handling for NAMEOID datatype -- looks like an array but treat like a scalar. Added regression test cases for null agument handling and tuple argument handling. Added ability to handle tuple arguments.
…onsistancy of style.
…ry to fail. Added macros to override R PROTECT/UNPROTECT as a debug aid; ifdef'd out but left for future use. Added lastoid function. Modified installed R functions to avoid '_' characters in the function names and added test cases for prepared queries and lastoid.
…favor of Unix EOLs (LF)